Help defining XML tags

MrAnon

Chieftain
Joined
Apr 25, 2006
Messages
38
Location
Virginia, USA, Sol 3, Milky Way...
Greets!

I've searched high, low and under the bed for a definition of these Warlords-added XML tags in Civ4UnitInfos.xml:

<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>

Obviously, I've had no success or I wouldn't be asking, "Can someone please tell me what these tags set?" I'm *guessing* that they indicate some kind of prioritization mechanism but beyond that the ol' logic train derails.

Can anyone hit me with a cluestick?

Thanks!
 
If you can do a search for "getTargetUnitClass" etc. in the SDK files, you can see where they are used. I didn't spend any time on this but CvGameTextMgr.cpp took me back to the key TXT_KEY_UNIT_TARGETS_UNIT_FIRST (in Civ4GameText_Warlords.xml), whose English version is "Targets any %s1_unit_list first in combat outside cities". Hope that makes sense, and helps.
 
It kinda goes along with my presumption of it's meaning. I'll start digging again when I get a chance from you starting point. I appreciate the help!
 
I looked in SDk files and think I found the answer.

When a unit attacks a stack, the best defender is selected to take part in the fight. At least, when the UnitClassTargets and UnitCombatTargets tags of the attacking unit are empty. If some kinds of units are specified in it, the defender will be selected only among the units of these kinds in the stack !! :eek:

For example, if you get to pikes the ability to target horses (UNITCOMBAT_MOUNTED in UnitCombatTargets), they will always attack horses in a stack, whatever the other units are. These tags have to be used cautiously, you can make monsters with them (that's probably why they are not used in standard game)

The UnitClassDefenders and UnitCombatDefenders are the opposite, a unit will always be selected as defender if some specific kind of unit attacks the stack, even if an other unit may have been a better defender.
 
Back
Top Bottom