View Full Version : Changing Upgrades of a Unit


vbraun
Nov 06, 2005, 08:06 PM
Everything you are going to need about how to change the upgrades of Units.

First open up Assests\XML\Units\CIV4UnitInfos.xml in Notepad or program of your choice.

Here is the part that says what the Warrior upgrades to: (Line 2617)
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_AXEMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_SPEARMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>

If you wanted to add another upgrade just add another <UnitClassUpgrade> thing.

Example with adding an upgrade to the SAM Infantry:
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_AXEMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_SPEARMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_SAM_INFANTRY</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>

If you wanted to get rid of an upgrade so that there is only one upgrade left. Just delete one of the <UnitClassUpgrade> things. Ex.
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_AXEMAN</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>

Now if you want no upgrades at all change the entire <UnitClassUpgrades> to this: <UnitClassUpgrades/>

<bUnitClassUpgrade> Is just a little boolen thing where if you have it at 1 it says yes do this, if you have 0 the no it won't upgrade. At least thats how it should work.

wertyguy
Nov 14, 2005, 10:12 AM
So how do you change the cost of the upgrade?

The Great Apple
Nov 14, 2005, 12:03 PM
The cost of upgrades is based on the sheild difference between the upgraded unit and the unit you are upgrading. I'm not quite sure what the factor is, but it can probably be changed somewhere.

Lord Olleus
Jan 12, 2006, 02:40 PM
globaldefines.xml
One value is the basic cost and the other is multiplied by the shield difference.