XML/Upgrade

An upgrade is a one time event which may be executed by a unit via the upgrade command. Once done once, they can never be done again in that game. Upgrades could be used to increase the stats of units, or, by setting a unit to require an upgrade, they can be used as an "unlocking" (or researching) method. The name of the XML will be the name of the upgrade, and must match the name of the folder it is placed in.

image
The path to the image that will be used as an button for that upgrade.

image-cancel
The path to the image that will be used as a cancel button to stop the upgrade.

time
The time it takes to perform an action.

unit-requirements
A list of units that are required before the upgrade can be commenced.

upgrade-requirements
A list of other upgrades that are required before the upgrade can be commenced.

resource-requirements
The resources consumed to perform the upgrade. These will not be returned unless the upgrade is canceled.

effects
If the upgrade is to increase stats, this is a list of units that will have their stats modified. GAE can use tags as well, which make the upgrade effect all units with that tag specified in their unit XML. Depreciated in GAE for the enhancements version.

max-hp
In a stat increasing upgrade, how much to increase the maximum HP by. Depreciated in GAE. In MegaGlest, a regenation attribute controls the HP regeneration. If the value-percent-multiplier is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier is false, then the number is static, meaning it increases or decreases by the amount specified.

max-ep
In a stat increasing upgrade, how much to increase the maximum EP by. Depreciated in GAE. In MegaGlest, a regenation attribute controls the EP regeneration. If the value-percent-multiplier is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier is false, then the number is static, meaning it increases or decreases by the amount specified.

sight
In a stat increasing upgrade, how much to increase the sight by. Depreciated in GAE. If the value-percent-multiplier is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier is false, then the number is static, meaning it increases or decreases by the amount specified.

attack-strenght
In a stat increasing upgrade, how much to increase the strength of all attacks by. Note the slight spelling error, which must be done in order to allow the tag to be recognized. GAE is able to substitute this with the properly spelled "attack-strength". Depreciated in GAE. If the value-percent-multiplier</tt> is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier</tt> is false, then the number is static, meaning it increases or decreases by the amount specified.

attack-range
In a stat increasing upgrade, how much to increase the range of all attacks by. Note that this can backfire if a unit has a ranged and a melee attack, since it will increase the range of both, so the unit could use its melee attack without even touching the foe. Depreciated in GAE. If the value-percent-multiplier</tt> is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier</tt> is false, then the number is static, meaning it increases or decreases by the amount specified.

armor
In a stat increasing upgrade, how much to increase armor by. Depreciated in GAE. If the value-percent-multiplier</tt> is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier</tt> is false, then the number is static, meaning it increases or decreases by the amount specified.

move-speed
In a stat increasing upgrade, how much to increase the move speed by. Note that this affects all move skills, so if using different move skills for different commands, it could backfire. Depreciated in GAE. If the value-percent-multiplier</tt> is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier</tt> is false, then the number is static, meaning it increases or decreases by the amount specified.

production-speed
In a stat increasing upgrade, how much to increase the speed on produce, upgrade, and morph skills. Depreciated in GAE. If the value-percent-multiplier</tt> is true, the number is a percentage (where 100 is the same as no multiplier, 200 is the same as a doubling the stat, and 50 is the same as halving the stat). If value-percent-multiplier</tt> is false, then the number is static, meaning it increases or decreases by the amount specified.

enhancements
This feature is only available in version 0.4 and later. The current way to boost stats in GAE is with enhancements, special elements that allow an upgrade to affect multiple different units differently. This is done with a parent &lt;enhancements&gt;</tt> element which contains as many child &lt;enhancement&gt;</tt> elements. These enhancement elements each contain their own &lt;affects&gt;</tt> element (same function as the affect element listed above, but can also be applied to tags, which will affect all units who had that tag applied to them in the unit XML), and then contain elements that are able to raise the unit's stats. Note that all elements besides affects are optional, so if a boost in that skill is not used, don't include the element at all. There's a few different kinds of boosts:

static-modifiers
Stats that are modified statically go up or down by a set amount for all affected units. The tag can be used outside of the enhancements tag, using the original affects tag, but this is depreciated. GAE Only.

Possible modifications:

These can all be children of the &lt;static-modifiers&gt;</tt> or &lt;multipliers&gt;</tt> tags, and have a single "value" attribute each which defines how much to increase, decrease, or multiply by.

multipliers
Multiplied stats are multiplied by a number instead of being increased or decreased by a set amount. Instead of increasing a wide variety of unit's attack by a certain, set amount which may or may not be accurate for their abilities, you can increase it by a percentage. For example, you could give them a static multiplier if 1.1 for attack, which means a 10% increase. This helps ensure that a wide variety of units get their stats raised proportionally instead of by fixed values. This is multiplied as it is, and not a percentage, thus a multiplier of 2 would double that stat, while a multiplier of 0.5 would half it. The tag can be used outside of the enhancements tag, using the original affects tag, but this is depreciated. The available values are in the table above. GAE Only.

point-boosts
Point boosts work like max-ep and max-hp, but instead of increasing the maximum, they increase the current. This makes it possible for a unit without EP regeneration to gain one time use EP. Each of these use a single value attribute to define how much to boost by, which must be a positive number. The two possible tags are &lt;ep-boost /></tt> and <tt>&lt;hp-boost /></tt>. These are both a child of <tt>&lt;point-boosts></tt>. The tag can be used outside of the enhancements tag, using the original affects tag, but this is depreciated. GAE only.

cost-modifiers
Working like static modifiers and multipliers, cost modifiers can change the resource cost of units. There can be as many children <tt>&lt;resource&gt;</tt> tags as you want, and each one lists the name of the resource to modify, and one of either an <tt>addition</tt> attribute or a <tt>multiplier</tt> attribute, which can either decrease or increase the unit's costs.

store-modifiers
Almost the same thing as cost-modifiers, store modifiers use the same syntax, with the resource name and an <tt>addition</tt> or <tt>multiplier</tt> attribute, but instead of modifying the resource costs, they modify what resources and how much the unit can hold.

subfaction-restriction
If the upgrade can only be commenced while in a certain subfaction, this tag is used. The only attribute is the name of the subfaction. GAE only.

advances-to-subfaction
If true, this upgrade will advance the faction into the specified subfaction. If is-immediate is false, the faction will advance into the subfaction after the upgrade is complete. If it's true, it advances into the subfaction the moment the upgrade starts. GAE only.