1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. I will no longer be hosting XLNation as of March 1, 2017. Unless some one steps forward to take over the domain name and provide hosting XLNation will shutdown. If you are seriously interested in taking on this project and can technically and financially support the project please contact me.

Adding custom furniture

Discussion in 'Modding Help Quarter' started by Immort_al, Oct 13, 2016.

  1. Immort_al

    Immort_al Mayor

    Joined:
    Oct 9, 2014
    Messages:
    206
    Likes Received:
    492
    Hi guys!
    How to make a custom furniture on a building visible the same as the default furniture?
    Here is tags from layout:

    <LayoutEntry>
    <ID>Furniture006</ID>
    <Type>FURNITURE</Type>
    <PrototypeFile>data/design/decoration/furniture/suit/f_admiralteystvo01.class</PrototypeFile>
    <Position>2.74219,-15.1932,33.978</Position>
    <Rotation>0.0,0.0,-0.999992,0.00394336</Rotation>
    <Scale>1.0,1.0,1.0</Scale>
    <Furniture>
    <PresenceProbability>1.0</PresenceProbability>
    </Furniture>
    </LayoutEntry>
    And here is a class file of my furniture:

    <Entity>
    <Type>EDITORELEMENT</Type>
    </Entity>
    <Display>
    <Model>Data/Gfx/Editor/dummy.sgbin</Model>
    <Placeholder>Data/Gfx/Placeholder/Building40.mesh</Placeholder>
    </Display>
    <Placement>
    <Type>EDITORELEMENT</Type>
    </Placement>
    <LayoutEntry>
    <ID>Furniture</ID>
    <Type>FURNITURE</Type>
    <Furniture>
    <PresenceProbability>1</PresenceProbability>
    <ResourceFile>
    Data/Gfx/Furnitures/f_admiralteystvo01.sgbin
    </ResourceFile>
    </Furniture>
    </LayoutEntry>
    The sgbin file has 2 lod with the same number of triangles (about 200).
     
  2. Mr.X²

    Mr.X² Moderator

    Joined:
    Aug 23, 2014
    Messages:
    1,072
    Likes Received:
    1,290
    create your custom furniture in 3dsmax using the furniture shader (or furniture transparent, but transparency wont work in xxl)
    ull find the specifications like namings and stuff in cxl modding guide Tutorial - Cities XL Complete Technical Guide and export the sgbin like usual

    then create a class file in data/design/decoration/furniture/...
    it looks like this (u can use this one as template or use one from your unpacked cxl)
    Code:
    <?xml version="1.0" encoding="Windows-1252"?>
    
    <Entity>
        <Type>EDITORELEMENT</Type>
    </Entity>
    <Display>
        <Model>Data/Gfx/furnitures/f_allianzarenafield_t3.sgbin</Model>
        <Placeholder>Data/Gfx/Placeholder/Building40.mesh</Placeholder>
    </Display>
    <Placement>
        <Type>EDITORELEMENT</Type>
    </Placement>
    <LayoutEntry>
        <ID>Furniture</ID>
        <Type>FURNITURE</Type>
        <Positioning>
                <OrientationType>ADJUST_VERTICAL</OrientationType>
        </Positioning>
        <Furniture>
            <PresenceProbability>1</PresenceProbability>
        <Visibility>Always</Visibility>
    <trulyalwaysvisible>1</trulyalwaysvisible>
            <ResourceFile>
          Data/Gfx/Furnitures/f_allianzarenafield_t3.sgbin
        </ResourceFile>
        </Furniture>
    </LayoutEntry>
    
    (trulyalwaysvisible makes your furniture visible at all times, only needed for large furniture like the field for allianzarena, dont do this for small things ;) )

    then open your main-mods layout file and add it like this:
    Code:
        <LayoutEntry>
            <ID>Field</ID>
            <Type>FURNITURE</Type>
            <PrototypeFile>data/design/decoration/furniture/packs/medieval/f_allianzarenafield_t3.class</PrototypeFile>
            <Position>0,0,0.1</Position>
            <Rotation>0.0,0.0,0.0,0.0</Rotation>
            <trulyalwaysvisible>1</trulyalwaysvisible>
        </LayoutEntry>
    remember, the furnitures position is taken from 0,0,0 in your max scene with pivot position of your main-model

    pack it together with your main mod - done
     
    Drazicdesign likes this.
  3. secpol

    secpol Mayor

    Joined:
    Oct 11, 2014
    Messages:
    173
    Likes Received:
    420
  4. Mr.X²

    Mr.X² Moderator

    Joined:
    Aug 23, 2014
    Messages:
    1,072
    Likes Received:
    1,290
    the shaders in community mod are updated for directx (11?) dunno, a newer version^^ ask @Altiris or maybe @Monty about this (i only know the very basics about usage of shaders)
    thats why they are not compatible with xl game version. but the xl shaders still work with xxl game version.

    yeah furniture_transparent shader has not been updated for xxl, thats why it can cause some troubles in xxl game (and transparency wont work in xxl anyway). should work fine in xl tho (it does for me). but if you want to make it work correctly in both versions i suggest to just use the standard furniture shader ;)
    and yes the ones from shader pack for modders are the correct ones and you can use an illumination map (y)
     
    secpol likes this.
  5. secpol

    secpol Mayor

    Joined:
    Oct 11, 2014
    Messages:
    173
    Likes Received:
    420
    More questions than answers, it is necessary to unify all:)
     
  6. secpol

    secpol Mayor

    Joined:
    Oct 11, 2014
    Messages:
    173
    Likes Received:
    420
    How to use as furniture, object a shader #Buiding? Is it possible to change the code in .layout file?
     
  7. Mr.X²

    Mr.X² Moderator

    Joined:
    Aug 23, 2014
    Messages:
    1,072
    Likes Received:
    1,290
    nope, #furniture (or #furniture_transparent_v1)
    yes of course u can change the layout file
     
  8. secpol

    secpol Mayor

    Joined:
    Oct 11, 2014
    Messages:
    173
    Likes Received:
    420
    How to do it? I need AO in furniture.
     

Share This Page