• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

XML: Battle reward?

Manifold

ModderProtectionAdvocate
Joined
Aug 27, 2007
Messages
1,580
i am searching for a way to benefit the victory over a specific unit. The only thing i find out is to increase <iXPValueAttack> and <iXPValueDefense> of the specific unit. Which other rewards are possible by xml?
 
By XML, I'm pretty sure nothing. In python though, you can grant a promotion and probably experience through a check in onCombatResult.

EDIT: I think something like this (untested, and I'm kind of a noob) would give experience:

PHP:
if (unitY.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_XYZ")):
	unitX.changeExperience(2,2,True,False,False)
 
I'm quite intrigued by this as well.

Which file controls how much XP is awarded for combat anyway? The one you quoted is familiar to me but seems to be a base factor - where would the multiplier be located though?

Winning at low odds for instance gives a lot more XP than winning at high odds does and tech difference in units (regardless of odds) also seems to matter.
 
There is a calculation in the Modiki. the experience reward related to <iXPValueAttack> and <iXPValueDefense> in the CIV4UnitInfos.xml.
 
Back
Top Bottom