layout handler, how does a random layout handler work?

ghost toast

Prince
Joined
Apr 29, 2022
Messages
477
so i have noticed a few times that things have a layout handler random as shown in this example

Code:
    <LandmarkArtInfo>
        <Era>Any</Era>
        <State>Any</State>
        <fScale>2.4</fScale>
        <ImprovementType>ART_DEF_IMPROVEMENT_NONE</ImprovementType>
        <ResourceType>ART_DEF_FEATURE_ATOLL</ResourceType>
        <LayoutHandler>RANDOM</LayoutHandler>
        <FXSXML>assets/DLC/Shared/Features/Feature_Atoll/Atoll_5.fxsxml</FXSXML>
        <bTerrainContour>True</bTerrainContour>
    </LandmarkArtInfo>

this one happens to be for the atoll feature.
but this is not limited to just the atoll the ancient ruins tile improvement also has variants 10 in fact

Code:
  <LandmarkArtInfo>
    <Era>Any</Era>
    <State>Any</State>
    <fScale>1.0</fScale>
    <ImprovementType>ART_DEF_IMPROVEMENT_GOODY_HUT</ImprovementType>
    <LayoutHandler>RANDOM</LayoutHandler>
    <ResourceType>ART_DEF_RESOURCE_ALL</ResourceType>
    <FXSXML>Assets/Buildings/Barbarians and Goody Huts/Goody_Huts/Ruins10.fxsxml</FXSXML>
    <bTerrainContour>True</bTerrainContour>
  </LandmarkArtInfo>

i was wondering of any one has ever played around with this.
does is work as it looks like it does, where i can assign more then one model and the game will randomly choose one? is that how the atoll and ruins achieved diversity in the models?

this is pretty interesting i would love to add variants to features and improvements that would be awesome.
wouldn't it be cool to build 1 improvement with a few different looks?
for example a factory that looks different every time you build one, but is still all the same improvement adding no extra coding but in the graphic defines.

i cant test this any time soon but i will and ill post here what i learn when the time comes.

if you already know the answer or would like to join the discussion feel free

Moderator Action: Thread moved to the main C&C forum as that is where general questions belong. leif
 
Last edited by a moderator:
i have tested the random layout handler it works with improvements resources features and natural wonders.
a great aspect for modders and modelers like me

it will randomly choose between any graphic set up as random in the art defines.
i have used up to 6 with out it breaking not sure how many variants it will allow for.
6 variants is decent enough for me i see no reason to for any more.
 
Last edited:
Top Bottom