Adding Promotions to a Custom Trait

ambelgra

Chieftain
Joined
Dec 17, 2008
Messages
51
Location
Brooklyn
I wanted to add 2 promotions to a custom trait but I dont want the promotions to be given to both unit types, i.e. City_Raider for armored units, Barrage_1 for Siege units.

I know both Armor and Siege units can obtain both promotions but how do I separate them in the TraitInfos.xml
 
You don't. Well, not without DLL modifications to add a second set to the trait info or to arrange it differently. As it is, you specify the promotions and then you specify the list of unitcombats to which all of the promotions apply.

But you can make 2 traits, each of which gives promotions to different unitcombat types and then give the civ both traits (a civ can have more than 2 traits, you know).
 
shouldn't be too hard to do for an SDK coder...
 
BTW, did you know that there is a structure in the TraitInfos <FreePromotionUnitCombats> that sounds like what you want? Here is a sample of how they use it...

in the aggressive they have:
Code:
<FreePromotionUnitCombats>
    <FreePromotionUnitCombat>
        <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
        <bFreePromotion>1</bFreePromotion>
    </FreePromotionUnitCombat> 
    <FreePromotionUnitCombat>
        <UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
        <bFreePromotion>1</bFreePromotion>
    </FreePromotionUnitCombat> 
</FreePromotionUnitCombats>
 
That lists the unit combats. All of them are given all of the promotions listed in the FreePromotionUnitCombats section. In your example, you can't give the UNITCOMBAT_MELEE different promotions than the UNITCOMBAT_GUN gets.

The way to get two different sets of promotions applied to two different sets of unit combats is to either make SDK and XML schema changes or to just give the civilization two different traits, each of which gives promotions to a different set of unit combats. (Or three to give different ones to 3 different groups, etc...)
 
That lists the unit combats. All of them are given all of the promotions listed in the FreePromotionUnitCombats section. In your example, you can't give the UNITCOMBAT_MELEE different promotions than the UNITCOMBAT_GUN gets.

The way to get two different sets of promotions applied to two different sets of unit combats is to either make SDK and XML schema changes or to just give the civilization two different traits, each of which gives promotions to a different set of unit combats. (Or three to give different ones to 3 different groups, etc...)

You are correct, lol, I was tired when I wrote that...
 
Top Bottom