I have a unit that has gained 10 experience points and still has not triggered a promotion. Is there a reason why a unit would not receive any promotions even though the unit gains lots of experience through combat?
No. This is a unit owned by a human in single player. Actual combat with enemy units is how this unit has gained experience. I'll try your recommended python line:
CyUnit.isPromotionReady()
...to see if it will work. I'll let you know what happens in my test results.
Did you end the turn in your test? A unit can get a bunch of experience but the promotions won't be availble until you end the turn and at hte start of the next next turn.
I discovered where the root problem was. It was in the CIV4PromotionInfos.xml file. What is really strange is that my mod changes that are identified with:
Code:
<!-- Army Mod -->
...is causing Civ4 not to recognize the promotion for the unit Combat type.
Code:
<!-- Army Mod -->
<UnitCombat>
<UnitCombatType>UNITCOMBAT_ARMY</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
<!-- End Army Mod -->
Once I took the identifier out, the promotion works for the unit. The identifier is how I document my changes to a file so that when people merge the mod, they know what to look for. What is wrong with having an XML identifier?
I agree commenting is a good idea in general, but in several xml files, *specifically* promotions and probably others, putting comments will mess up the loading. When the parser does a first pass, it counts the number of promotions, but somehow when it does a second pass, it includes comments in the count. Then the attributes don't connect to the right promotions, and many weird things can happen.
It is sad, but I have taken the rule of never putting comments into civ xml files except at the top of the file.
you can comment fairly save as long as you know how to. If you use a debug DLL you will get Asserts if you make comments at wrong places. The general rule is to never have a line with only a comment. The parser will not understand it is a comment and try to load your comment as a game item
instead of the above use this and it should work
Code:
<UnitCombat> <!-- Army Mod -->
<UnitCombatType>UNITCOMBAT_ARMY</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat> <!-- End Army Mod -->
Could be that in some exotic files like the audio xml comments always cause trouble.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.