Granting a racial ability through an event or on startup.

What the title says. I'm trying to mod in a race trait that gives you other race traits. I'm doing this because I want to make a super-overpowered villain faction so I can have several species unite and fight against it, but I also don't want to clutter the UI. I basically want to give them all of the player faction traits like Adaptable, Slavers, etc. but instead of having a very long list of traits I just want to give them the abilities for it, mostly for the tech unlocks. That way they can build extremely tall from their small amount of planets.

Here's what I have so far. The game won't start up, something about scope. I'm open of other wants to doing this, such as through a invisible event the players can't see or trigger.

Code: xml
  1. <RaceTrait>
  2. <InternalName>TimelordsAbility</InternalName>
  3. <DisplayName>TimelordsAbility_Name</DisplayName>
  4. <DisplayNameShort>TimelordsAbility_ShortName</DisplayNameShort>
  5. <Description>TimelordsAbility_Dec</Description>
  6. <span style="white-space: normal;"> &lt;IsAbility&gt;1&lt;/IsAbility&gt;</span>
  7. <span style="white-space: normal;"> &lt;Available&gt;false&lt;/Available&gt;</span>
  8. <span style="white-space: normal;"> &lt;Triggers&gt;</span>
  9. &lt;OnEvent&gt;OnStartTurn&lt;/OnEvent&gt;
  10. &lt;CriteriaTurnNum&gt;1&lt;/CriteriaTurnNum&gt;
  11. &lt;Scope&gt;Global&lt;/Scope&gt;
  12. &lt;Target&gt;
  13. &lt;TargetType&gt;Faction&lt;/TargetType&gt;
  14. &lt;/Target&gt;
  15. &lt;Lifetime&gt;Instant&lt;/Lifetime&gt;
  16. <span style="white-space: normal;"> &lt;Modifier&gt;</span>
  17. <span style="white-space: normal;"> &lt;RaceTraits&gt;LoyalAbility&lt;/RaceTraits&gt;</span>
  18. <span style="white-space: normal;"> &lt;/Modifier&gt;</span>
  19. <span style="white-space: normal;">  &lt;DisplayOnTooltip&gt;false&lt;/DisplayOnTooltip&gt;</span>
  20.     &lt;/Triggers&gt;

3,707 views 2 replies
Reply #1 Top

i have never tried it, but couldn't you just create a factiondefs.xml in your mod dir. Or edit the one at C:\Games\Galactic Civilizations IV Supernova\Data\Gameplay\FactionDefs.xml. Then just add in the racetraits? At least one of the default races has more than the 2 it lets you choose in the faction editor. (Cant remember which one though. Just remember seeing it.) I havn't messed with factiondefs.xml yet because there may be some hard coded links to other files I dont know about. Like in faction editor if you choose ravenous for your new faction of humans. It still produces Festron for some reason when you use it. Anyways hope that helps...

Reply #2 Top

That's what I'm doing right now, directly editing the .xml file, but it's pretty flawed. I eventually want to make an if/then branch (which I know how to do) which gives the Super-Antagonist Empire more or fewer racial traits depending on how many other empires are playing. Even better, I'd also even just like to have an event (like Gigastructural Engineering does for Stellaris) that scales how many racial or leadership traits the enemy faction has.

In fact, that might be one of the best ways to do this. Have a bunch of events that give the enemy empire additional traits at turns 50, 150, etc.