Unit not receiving promotions with experience

You mean a AI unit? I really wouldn't know what the problem is but how is the XP gained? Through actual combat?

Maybe try to use CyUnit.setPromotionReady() if you find a unit with unused XP that doesn't respond to CyUnit.isPromotionReady().
 
You mean a AI unit? I really wouldn't know what the problem is but how is the XP gained? Through actual combat?

Maybe try to use CyUnit.setPromotionReady() if you find a unit with unused XP that doesn't respond to CyUnit.isPromotionReady().

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.

Thanks.
 
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. :crazyeye:

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? :crazyeye: :crazyeye:
 
Nothing wrong with commenting, but some files (e.g. the audio files) don't like it :dunno:.

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.
 
Top Bottom