Help! My promotions aren't promoting!

macantas

Chieftain
Joined
Mar 17, 2007
Messages
15
I've been racking my brain, trying to figure out why this isn't working, so I thought I'd open it up to the minds out there.

I'm using the editor that Kael made to create FFH, but for a mod that is more closely similar to the Charlemagne scenario from BtS. Actually, I've stripped the Charlemagne scenario of all its Python scripts, so I'm using the base XML that came with it, but have completely rewritten the Civilizations, Leaders, added a new Academy building, and new promotions.

Everything is working fine, except the promotions I've entered. My idea was to have unique promotions available to the 10 different civilizations I've made. Each civ can build a special academy building unique to its own civ, which will give all new units a free starting promotion. These promotions can only be achieved through this method.

I followed the Doctrine Only method I'd noticed in Total Realism. Basically, there is a promotion called DOCTRINE_ONLY which is available to NO UnitCombats so that no unit can ever achieve it. The construction of the academy will give a unit (let's say a Pyrean Warrior) a free Pyrean I promotion, whose prereq promo is Doctrine_Only. This means that Pyrean I cannot be achieved except through the presence of a Pyrean Academy. This part works fine (after some debugging).

The problem is, when this Pyrean Warrior gets enough experience, it should be able to upgrade to the Pyrean II promotion (which is dependent only on having Pyrean I already). But instead, the unit only has access to the other promotions it would normally have (ie. combat1, shock1, etc).

Is there something I have forgotten to do or overlooked? Or is this example so convoluted in itself that only through looking through the code will the answer become evident? I've looked through several times, and am pretty confident Kael's Editor I'm using isn't making any mistakes (I did go through several of the VisualBasic code for the Editor, to ensure that there's no FFH factors playing into my non-FFH mod).

Any ideas/comments?
 
Have you been using the PreReq or the PreReqOr tag in the XML? Have you tried using both? (probably not at the same time)

I'm not too familiar with the Promotions dealie yet, I'm going to probably start making some headway in creating a new XML editor on Monday when I get some information regarding nested XML elements. Darn you Excel!! (*Shakes fist*)

I may be able to help with most XML problems within a couple of weeks but you probably won't have to wait that long because someone else will probably come up with the answer soon.
 
Hmmm. I tried your suggestion, but alas nothing changed. Is there any Python set up required for new promotions beyond what goes in the XML files?

Thanks for the idea though. :)
 
I don't see anything in the Python that deals with this. It is possible that I missed it though.
 
Here's the 3 promotions for Doctrine, Pyrean1 and Pyrean2. The problem is getting Pyrean2 to be available to a melee (or any) unit once they have Pyrean1.

Sorry the formatting doesn't work on the Spoiler. Is there a way to keep the indentations?

Spoiler :
<PromotionInfo>
<Type>PROMOTION_DOCTRINE</Type>
<Description>TXT_KEY_PROMOTION_DOCTRINE</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>NONE</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<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>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<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>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks>
</TerrainAttacks>
<TerrainDefenses>
</TerrainDefenses>
<FeatureAttacks>
</FeatureAttacks>
<FeatureDefenses>
</FeatureDefenses>
<UnitCombatMods>
</UnitCombatMods>
<DomainMods>
</DomainMods>
<TerrainDoubleMoves>
</TerrainDoubleMoves>
<FeatureDoubleMoves>
</FeatureDoubleMoves>
<UnitCombats>
</UnitCombats>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Promotions/Combat1.dds,Art/Interface/Buttons/Promotions_Atlas.dds,8,2</Button>
</PromotionInfo>

<PromotionInfo>
<Type>PROMOTION_PYREA1</Type>
<Description>TXT_KEY_PROMOTION_PYREA1</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>PROMOTION_DOCTRINE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>NONE</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<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>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<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>10</iCombatPercent>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks>
</TerrainAttacks>
<TerrainDefenses>
</TerrainDefenses>
<FeatureAttacks>
</FeatureAttacks>
<FeatureDefenses>
</FeatureDefenses>
<UnitCombatMods>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
<iUnitCombatMod>10</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<DomainMods>
</DomainMods>
<TerrainDoubleMoves>
</TerrainDoubleMoves>
<FeatureDoubleMoves>
</FeatureDoubleMoves>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Civilizations/Russia.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,4,4</Button>
</PromotionInfo>

<PromotionInfo>
<Type>PROMOTION_PYREA2</Type>
<Description>TXT_KEY_PROMOTION_PYREA2</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>PROMOTION_PYREA1</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>NONE</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<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>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<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>15</iCombatPercent>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks>
</TerrainAttacks>
<TerrainDefenses>
</TerrainDefenses>
<FeatureAttacks>
</FeatureAttacks>
<FeatureDefenses>
</FeatureDefenses>
<UnitCombatMods>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
<iUnitCombatMod>15</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<DomainMods>
</DomainMods>
<TerrainDoubleMoves>
</TerrainDoubleMoves>
<FeatureDoubleMoves>
</FeatureDoubleMoves>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey></HotKey>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/Civilizations/Russia.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,4,4</Button>
</PromotionInfo>
 
Okay, so in an effort to help fix this problem, I converted my entire mod to Modular programming (and for the sake of up-coming more complicated expansions). I hoped this would fix the promotions problem; it did, but created an even bigger problem.

Now, for some reason, the hierarchy of promotions are all out of wack. Initial units have free range to upgrade to every single promotion I've added (completely ignoring prerequisites), but basic Civ promotions like Shock and Cover suddenly need to have my added promotions as prereqs, even when I double check the XML to make sure everything looks the way it should.

Any ideas what could be causing this problem? Have I discovered some promotions bug, cause everything else about the mod works fine.
 
Code:
code tags will help spacing  Use [ code ] and [ /code ]
(without the white space around the word code, naturally)

The first thing you should do is make sure that your promotion will work without tricks. Remove the dependency on Docterine. Now can every unit get the promotion? Get the upgrade to the promotion?

I'm guessing that will work, but if it doesn't, that tells you something...

The next step I'd follow is I'd start to look at the python/SDK code that determines which promotions can be gotten.

I don't know how to fix your modular loading problems.
 
This looks to be a modular loading problem. When I copy all your promotion information directly into the main promotion file it works correctly.

Specifically I suspect thast its a self-referencing issue (promotions cant refer to promotions because that promotion may not be loaded yet). The Civ4 wngine jumps through some hoops to do this, specifically it saves off the pointer until later and then comes back and builds the association. I think it is saving the pointer, then loading the modular promotion file and the pointer is now pointing to the wrong promotion (so you have weird things like a promotion that requires the 3rd promotion in the normal file now requires the 3rd promotion in the modular file).

I would recommend not using modular loading for promotions.
 
I switched it back to non-modular loading for promotions, and it works ... better. At least the promotions appear to be pointing in the right direction. But that returns me to my original problem before I incorporated modular programming:

When loading the mod and viewing the Civilopedia, all appears to work as normal. But when I run it to test it, something isn't quite connecting. I build the Pyrean Academy and all future units built in that city get the free Pyrean I promotion. But when they get more experience, they are only able to add the normal promo upgrades (like Drill I, Combat I, etc) and cannot progress to Pyrean II, even though the only requirement for Pyrean II is to have Pyrean I. Any idea why that would be?
 
Works fine for me. Make sure to delete the units file from your modular directory. Any promotion file in there is going to mess up your results.

Incidently there are a few UnitAI types missing from from your BasicInfos/CIV4UnitAIInfos.xml file. Thats causing RTTI errors whenever you try to modify a unit with the worldbuilder. You should probably just delete that file from your mod, I cant think of any reason to remove entries from that file.
 
Back
Top Bottom