How do I add a promotion?

zulu9812

The Newbie Nightmare
Joined
Jan 29, 2002
Messages
6,388
Location
Athens of the North
I'm looking to add a promotion from a different mod into the SevoMod. Obviously, I can take the graphics (i.e. the button) from this other mod, but the situation gave me an idea. What are the steps I need to add a promotion? What do I need to add to which XML files? Is there any python work involved? Would I have to recompile a new SDK? etc.
 
You'll need to go into the Civ4PromotionInfos xml that is in the Units folder to define your new (or copied) promotion. So you could add PROMOTION_HAMMER there and also define which UNITCOMBAT types can acquire this promotion. I think that's all there is, but can easily be mistaken.
 
zulu9812 said:
I'm looking to add a promotion from a different mod into the SevoMod. Obviously, I can take the graphics (i.e. the button) from this other mod, but the situation gave me an idea. What are the steps I need to add a promotion? What do I need to add to which XML files? Is there any python work involved? Would I have to recompile a new SDK? etc.


what woodelf said ;)

as long as you dont want to modify AI behavior (SDK/Python) you should be able to "invent" a new promotion without having too much hassle...

XML is the way to go

I personally havent created any promotions... but I have made various buildings/wonders and techs.... without any major problems... since I only edit/mod xml files


Techs are alittle hassle but as long as you stay in the "vanilla AI" parameters it isnt too hard...

best is to take a promotion similar to what you want.... copy it and edit that... renaming the promotion and such.... follow the format and viola :D you have a new promotion....

hope that helps ;)
 
Mmm...I'm missing something then. Could someone take a look at the last 3 promotions in this file and see if there's anything wrong with them? They're not showing up in game for me.
 
Not showing up in the civilopedia or in game at all? It says you need Combat3 to see the Army1 promo as well as Feudalism. Do you definitely have the prereqs? Nothing is standing out.
 
The promotions are showing up in the civilopedia, and in the uni editor of the world builder. I tested it by using the World Builder to give myself all techs up to and including the industrial era, and gave a unit 400XP. Went back into the game, promoted the unit to Combat 3 but no Army promotion. What's making me think that I need to edit another xml file is the fact that the 3 promotions' entries in the civilopedia aren't showing up as Army 1, Army 2, etc. but as TXT_KEY_PROMOTION_ARMY...
 
You'll need a simple Text file to rename TXT_KEY_PROMOTION_ARMY1 to say "Army1"...or simply type in "Army 1" instead of TXT_KEY_PROMOTION_ARMY1 in the Civ4Promotions XML file. If the only language is English you can get away with that easily enough.

Is the unit class you're trying to promote eligible for this promotion? Sorry, had to ask.
 
And also to humor me can you remove the prereq tech and see what happens when you just need the Combat 3 prereq?
 
woodelf said:
You'll need a simple Text file to rename TXT_KEY_PROMOTION_ARMY1 to say "Army1"...or simply type in "Army 1" instead of TXT_KEY_PROMOTION_ARMY1 in the Civ4Promotions XML file. If the only language is English you can get away with that easily enough.

Thanks, that worked. However, I can't help notice that all the other promotions in the file use the TXT_KEY format - leading me to believe that they reference another xml file (possibly something to do with the civilopedia)

woodelf said:
Is the unit class you're trying to promote eligible for this promotion? Sorry, had to ask.

It was a Warrior unit - that's Melee class, no?

woodelf said:
And also to humor me can you remove the prereq tech and see what happens when you just need the Combat 3 prereq?

I set the tech prerequisite to NONE, but the promotion still wasn't showing up as a promotion option for the unit.
 
The XML file referanced is one in the XML/Text directory. I think it's the objects one, but I don't have it to hand. That XML file contains translations for all the objects into different languages - the 'TXT_KEY' links to them, and the right translation is put in it's place in-game. If you just put normal text there then it just sticks that text in instead (no translations). If there is nothing to link to this should not cause an error.

As for why it isn't working - is it just those three that aren't working? Are the other added ones working?

EDIT: No... wait, the other ones seem to be unobtainable.

Maybe tech prequesites don't work properly. None of the defaults have them. I would have thought it would have been mentioned. I would suggest removing them and seeing what happens. If that doesn't work, try removing other bits (returning to default - combat 1) until it works.
 
zulu9812 said:
Thanks, that worked. However, I can't help notice that all the other promotions in the file use the TXT_KEY format - leading me to believe that they reference another xml file (possibly something to do with the civilopedia)



It was a Warrior unit - that's Melee class, no?



I set the tech prerequisite to NONE, but the promotion still wasn't showing up as a promotion option for the unit.

There are Two or Three files you need to modify (depending on what you want to do with the promotion)

Ive made a few promotions for the Planet Roanoke mod from scratch, and the files you need to edit are

/Assets/XML/Units/CIV4PromotionInfos.xml
/Assets/XML/Text/CIV4GameTextInfos_Units.xml

And if you want to give the promotion to a unit type automatically

/Assets/XML/Units/CIV4UnitInfos.xml
 
Here is an example promotion which gives +1 movement (ROVER III)

This goes in the

/Assets/XML/Units/CIV4PromotionInfos.xml

<PromotionInfo>
<Type>PROMOTION_ROVER3</Type>
<Description>TXT_KEY_PROMOTION_ROVER3</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<PromotionPrereqOr1>PROMOTION_ROVER2</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>NONE</TechPrereq>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iVisibilityChange>0</iVisibilityChange>
<iMovesChange>1</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</iNeutralHealChange>
<iFriendlyHealChange>0</iFriendlyHealChange>
<iSameTileHealChange>0</iSameTileHealChange>
<iAdjacentTileHealChange>0</iAdjacentTileHealChange>
<iCombatPercent>0</iCombatPercent>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsDefense>0</iHillsDefense>
<TerrainDefenses/>
<FeatureDefenses/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_AIRBORNE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Promotions/Flanking1.dds,Art/Interface/Buttons/Promotions_Atlas.dds,6,3</Button>
</PromotionInfo>
 
ACTUALLY, I think I see where the problem is (but im not sure how to make it work other than remove it!), as it looks like youve designated the units available to gain the promotion correctly ...

I had a similar issue trying to give my new Recon Units a series of promotions which included a withdrawal rate bonus, and then trying to give my Armored units collateral damage.

The reason (i think) is that it has to be already designated as a special unit class to use WITHDRAWAL and COLLATERAL damage.... not sure, but you could try to take the withdrawal and collateral bonuses out and see if the promotions become available.
 
jenks said:
The reason (i think) is that it has to be already designated as a special unit class to use WITHDRAWAL and COLLATERAL damage.... not sure, but you could try to take the withdrawal and collateral bonuses out and see if the promotions become available.

That was it! Thanks! If I take those parts out, the promotion becomes available.

Okay, now does anyone know how to make units part of these special unit classes?
 
zulu9812 said:
That was it! Thanks! If I take those parts out, the promotion becomes available.

Okay, now does anyone know how to make units part of these special unit classes?

Yeah im looking for that answer myself :crazyeye:

As a temporary fix i have changed my promotion concept (from Rover giving +10%withdrawal at levels I and II, with a +1movement at level III, to I = 1xfirst strike, II = +1 visibility, III = +1 movement)

i think that the combat classes which are to be given these abilities must be declared in another file somewhere, but i dont know why ive had the bug specifically with withdrawal and collateral and not anything else :(
 
I've looked at the unit classes and unit infos xml files, but there doesn't seem to be anything there. And Civ4 is supposed to be the game where nothing is hard-coded...
 
Back
Top Bottom