XML/Upgrade

From MegaGlest
Revision as of 00:43, 25 June 2011 by Hofmic (talk) (XML_definition_header)
Jump to: navigation, search

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.

XML

GAE Only
MegaGlest Only
GAE and MegaGlest Only
<?xml version="1.0" standalone="no"?>
<upgrade>
    <image path="images/image.bmp"/>
    <image-cancel path="images/cancel.bmp"/>
    <time value="500"/>
    <unit-requirements>
        <unit name="unit_name"/>
    </unit-requirements>
    <upgrade-requirements>
        <upgrade name="upgrade_name"/>
    </upgrade-requirements>
    <resource-requirements>
        <resource name="resource_name" amount="#"/>
    </resource-requirements>
    <effects>
        <unit name="unit_name"/>
    </effects>
    <max-hp value="0"/>
    <max-ep value="0"/>
    <sight value="0"/>
    <attack-strenght value="0"/>
    <attack-range value="0"/>
    <armor value="0"/>
    <move-speed value="0"/>
    <production-speed value="0"/>
    <!-- Start GAE Only -->
    <static-modifiers>
        <max-hp value="#"/>
        <max-ep value="#"/>
        <hp-regeneration value="#"/>
        <ep-regeneration value="#"/>
        <sight value="#"/>
        <armor value="#"/>
        <attack-strength value="#"/>
        <effect-strength value="#"/>
        <attack-percent-stolen value="#"/>
        <attack-range value="#"/>
        <move-speed value="#"/>
        <attack-speed value="#"/>
        <production-speed value="#"/>
        <repair-speed value="#"/>
        <harvest-speed value="#"/>
    </static-modifiers>
    <multipliers>
        <max-hp value="#"/>
        <max-ep value="#"/>
        <hp-regeneration value="#"/>
        <ep-regeneration value="#"/>
        <sight value="#"/>
        <armor value="#"/>
        <attack-strength value="#"/>
        <effect-strength value="#"/>
        <attack-percent-stolen value="#"/>
        <attack-range value="#"/>
        <move-speed value="#"/>
        <attack-speed value="#"/>
        <production-speed value="#"/>
        <repair-speed value="#"/>
        <harvest-speed value="#"/>
    </multipliers>
    <point-boosts>
        <ep-boost value="20"/>
    </point-boosts>
    <subfaction-restrictions>
        <subfaction name="subfaction_name"/>
    </subfaction-restrictions>
    <advances-to-subfaction name="subfaction_name" is-immediate="false"/>
    <!-- End GAE Only -->
</upgrade>

Documentation

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.

max-hp

In a stat increasing upgrade, how much to increase the maximum HP by.

max-ep

In a stat increasing upgrade, how much to increase the maximum EP by.

sight

In a stat increasing upgrade, how much to increase the sight by.

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".

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.

armor

In a stat increasing upgrade, how much to increase armor by.

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.

production-speed

In a stat increasing upgrade, how much to increase the speed on produce, upgrade, and morph skills.

static-modifiers

Main article: GAE/Upgrades

Stats that are modified statically go up or down by a set amount for all effected units. This is basically the old upgrade system. GAE Only.

Possible modifications:

Value Description
<max-hp> Modifies the maximum HP.
<hp-regen> Modifies the HP regeneration rate.
<max-ep> Modifies the maximum EP.
<ep-regen> Modifies the EP regeneration rate.
<sight> Modifies the unit's sight.
<armor> Modifies the unit's armor strength.
<attack-strength> Modifies the unit's attack strength.
<attack-range> Modifies the unit's attack ragen.
<attack-speed> Modifies the unit's attack speed.
<move-speed> Modifies the speed the unit moves at.
<production-speed> Modifies the production speed (speed of creating units or morphing).
<repair-speed> Modifies the speed of the repair skill.
<harvest-speed> Modifies the speed of the harvest skill.
<effect-strength> Modifies the strength of effects.

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

multipliers

Main article: GAE/Upgrades

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. 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 <ep-boost /> and <hp-boost />. These are both a child of <point-boosts>.

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.

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.

See also