I've been experimenting a little with creating a unique race where buildings, units and items will only be available for that particular race.
So far the prerequisites listed seem to have been limited to Tech and Allegiance. But you can also specify Race.
There is still a lot of trial and error, and I'm not sure what the impact is on changing the race to make it unique (in the default game the only races specified are Men and Fallen).
As an experiment I wanted to have a unique dwarven race that can build golems. I don't want any other race to have this ability.
Here's where I am at present...
Race specification:
Code: xml
- <RaceConfigs>
- ...
- <RaceConfig InternalName="Das_Race_Dwarves">
- <DisplayName>Dwarves</DisplayName>
- <ShortName>Dwarves</ShortName>
- <Description>...</Description>
- <FactionAllegiance>Kingdom</FactionAllegiance>
- <IsCustom>true</IsCustom>
- <RaceInternalName>Race_Type_Dwarves</RaceInternalName>
- <RaceClassification>Dwarves</RaceClassification>
- <RaceDisplayName>Dwarves</RaceDisplayName>
- ... etc etc
- </RaceConfig>
- </RaceConfigs>
Notice that RaceClassification is 'Dwarves'. In all other races this is either Men or Fallen.
Then for the building:
Code: xml
- <ImprovementTypes>
- ...
- <ImprovementType InternalName="Das_ClaimedGolem">
- <DisplayName>Golem Foundry</DisplayName>
- <Description>This foundry will send our nearest settlements golems to train.</Description>
- <TileDesign>Das_Golem_Foundry_01</TileDesign>
- <ConstructionTileDesign>Das_Golem_Foundry_Build_01</ConstructionTileDesign>
- <SupportedTerrainType>City</SupportedTerrainType>
- <SupportedTerrainType>Land</SupportedTerrainType>
- ... etc etc
- <Prereq>
- <Type>Race</Type>
- <Attribute>Dwarves</Attribute>
- </Prereq>
- </ImprovementType>
- </ImprovementTypes>
Note that the Prereq/Type = 'Race' and the Prereq/Attribute = 'Dwarves'.
This will allow only my dwarven race to build the Golem Foundry.
The same approach can then be applied to tech, items etc.
But I have a couple of questions for the modders who have a better grip on the code:
1. How do we change FactionAllegiance to make it custom as well?
2. Does changing RaceClassification from 'Men' to Dwarves' have other negative effects (such as can't recruit, study or build items)?
3. Is there a way to have a race be both 'Men' and 'Dwarves'? I tried adding a second RaceClassification but it overwrote its classification with whichever was specified second (which is good to know as well).