[XML] Unique Races - Buildings, Units, Items, Tech etc.

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
  1. <RaceConfigs>
  2.     ...
  3.     <RaceConfig InternalName="Das_Race_Dwarves">
  4.         <DisplayName>Dwarves</DisplayName>
  5.         <ShortName>Dwarves</ShortName>
  6.         <Description>...</Description>
  7.         <FactionAllegiance>Kingdom</FactionAllegiance>
  8.         <IsCustom>true</IsCustom>
  9.         <RaceInternalName>Race_Type_Dwarves</RaceInternalName>
  10.         <RaceClassification>Dwarves</RaceClassification>
  11.         <RaceDisplayName>Dwarves</RaceDisplayName>
  12.         ... etc etc
  13.     </RaceConfig>
  14. </RaceConfigs>

Notice that RaceClassification is 'Dwarves'. In all other races this is either Men or Fallen.

Then for the building:

Code: xml
  1. <ImprovementTypes>
  2.     ...
  3.     <ImprovementType InternalName="Das_ClaimedGolem">
  4.         <DisplayName>Golem Foundry</DisplayName>
  5.         <Description>This foundry will send our nearest settlements golems to train.</Description>
  6.         <TileDesign>Das_Golem_Foundry_01</TileDesign>
  7.         <ConstructionTileDesign>Das_Golem_Foundry_Build_01</ConstructionTileDesign>
  8.         <SupportedTerrainType>City</SupportedTerrainType>
  9.         <SupportedTerrainType>Land</SupportedTerrainType>
  10.         ... etc etc
  11.         <Prereq>
  12.             <Type>Race</Type>
  13.             <Attribute>Dwarves</Attribute>
  14.         </Prereq>
  15.     </ImprovementType>
  16. </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).

5,834 views 2 replies
Reply #1 Top

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).
End of quote

1. You can change FactionAlliegance to whatever you want BUT the faction screen will only show Kingdom and Empire factions (I tried it for my amazon faction and no luck). Until that can be modded, we are stuck with those two FactionAlliegances.

2. I haven't tried. I suppose that anything that has Men RaceClassification as prerequisite would be a no no.

3. I don't think so. Trying to add more than one tech requirement to some things didn't work either (or I failed to make it well).

Reply #2 Top

Hopefully we will be able to create new allegiances to solve 3).