So I have been teaching myself how to mod GC IV, step by step, as I go. When I started about a month or so ago, I had almost no understanding of XML, but now I at least have a basic grasp of it, at least as far as how GC IV uses it. But now I want to try to add something into my mod that doesn't quite "fit" neatly into the game, so I wanted to see how others would go about putting my idea into my mod. Let me know what you think.
In Galactic Civ 3, the player could build legions to use to invade planets, but in GC IV we now make citizens specialize into soldiers, or use high Resolve citizens in transport ships to invade enemy planets. I have no issues with this new mechanic, but I would like to think that since there are Techs like "Stellar Marines" and "Killbots", that these units could be utilized to invade planets. So, what I was thinking was to make "Stellar Marines" and "Killbots" and other similarly veined units, available as a production option, similar to clones or Yor population (i.e., an improvement project). I have already added a similar project which allows the player to create a cybernetic genetically augmented clone as a planetary citizen, but I must be going about making "Stellar Marines" the wrong way. Since the purpose of the Stellar Marines would be to use them in planetary invasions, I have added a trait to my mod, intended only for them, and intended to produce relatively consistent unit stats, but I know that it is not working as I wanted it to.
Simply put, I want to be able to produce a citizen, with specific stats. And I also want to have an improvement project that creates a "citizen" unit of a different race (for example, if I am playing as Torians, I want the project to produce a unit of non-Torian, synthetic-lifeform robots, with high resolve and diligence). How would you suggest I go about implementing this?
<UnitTrait>
<InternalName>UnitTrait_StellarMarine</InternalName>
<DisplayName>UnitTrait_StellarMarine_Name</DisplayName>
<Description>UnitTrait_StellarMarine_Dec</Description>
<Icon>LeaderTrait_Veteran.png</Icon>
<ForPlanetaryCitizen>true</ForPlanetaryCitizen>
<Stats>
<EffectType>Resolve</EffectType>
<Scope>Local</Scope>
<Target>
<TargetType>Unit</TargetType>
</Target>
<BonusType>Flat</BonusType>
<RangeMin>20</RangeMin>
<RangeMax>25</RangeMax>
</Stats>
<Stats>
<EffectType>Intelligence</EffectType>
<Scope>Local</Scope>
<Target>
<TargetType>Unit</TargetType>
</Target>
<BonusType>Flat</BonusType>
<RangeMin>6</RangeMin>
<RangeMax>9</RangeMax>
</Stats>
<Stats>
<EffectType>Social</EffectType>
<Scope>Local</Scope>
<Target>
<TargetType>Unit</TargetType>
</Target>
<BonusType>Flat</BonusType>
<RangeMin>4</RangeMin>
<RangeMax>6</RangeMax>
</Stats>
<Stats>
<EffectType>Diligence</EffectType>
<Scope>Local</Scope>
<Target>
<TargetType>Unit</TargetType>
</Target>
<BonusType>Flat</BonusType>
<RangeMin>5</RangeMin>
<RangeMax>10</RangeMax>
</Stats>
<ExcludeFromRandomCitizens>true</ExcludeFromRandomCitizens>
</UnitTrait>
The Improvement I have added is as follows... anyone see anything wrong or have any ideas to improve it?
<Improvement>
<InternalName>RecruitStellarMarine</InternalName>
<DisplayName>RecruitStellarMarine_Name</DisplayName>
<ShortDescription>RecruitStellarMarine_ShortDec</ShortDescription>
<Description>RecruitStellarMarine_Dec</Description>
<Icon>Leader_Minister.png</Icon>
<BuildIcon>Leader_Minister_Build.png</BuildIcon>
<ListIcon>Leader_Minister_Icon.png</ListIcon>
<ImprovementType>DurationalProject</ImprovementType>
<SecondaryType>Special</SecondaryType>
<PlacementType>Special</PlacementType>
<UnderPopulationCapOnly>true</UnderPopulationCapOnly>
<Stats>
<EffectType>ManufacturingCost</EffectType>
<Scope>Queue</Scope>
<Target>
<TargetType>Improvement</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>3250</Value>
</Stats>
<Stats>
<EffectType>PromethionCost</EffectType>
<Target>
<TargetType>Improvement</TargetType>
</Target>
<BonusType>OneTime</BonusType>
<Value>4</Value>
</Stats>
<Stats>
<EffectType>DurantiumCost</EffectType>
<Target>
<TargetType>Improvement</TargetType>
</Target>
<BonusType>OneTime</BonusType>
<Value>2</Value>
</Stats>
<Triggers>
<OnEvent>OnConstructImprovment</OnEvent>
<Target>
<TargetType>Colony</TargetType>
</Target>
<Lifetime>Instant</Lifetime>
<PerformAction>
<Action>CreateUnitOnPlanet</Action>
<StringParam>Defender</StringParam>
<StringParam>DEFAULT</StringParam>
<StringParam>UnitTrait_StellarMarine</StringParam>
</PerformAction>
</Triggers>
<Prerequ>
<Techs>
<Option>Tech_Cloning</Option>
</Techs>
</Prerequ>
<Preclusions>
<RaceTrait>
<Option>SyntheticLife</Option>
</RaceTrait>
</Preclusions>
</Improvement>
As a noob to xml, I thank anyone for their input!