XML/Commands

Commands are the actions that a unit can be given. Unlike skills, which are called by commands, commands are directly the result of user interaction. For example, an attack command can be called by the player to issue an attack on the foe. All commands require some types of skills, which they use to find information like speed or the model. }

Stop
The stop command does exactly as its name implies: it stops the unit and cancels their queue. If the unit isn't doing something, it automatically stops.

type
The type of the command, in this case, stop. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

stop-skill
The name of the stop skill to use.

Move
The move command is used to allow the unit to move from place to place.

type
The type of the command, in this case, move. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

Repair
The repair command is generally used for healing units of any kind, buildings or otherwise.

type
The type of the command, in this case, repair. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

repair-skill
The name of the repair skill to use.

repaired-units
A list of units that can be repaired with this command. If you have radically different units, such as buildings and regular units, you could make two repair skills, such as one that "heals" humanoids and one that "repairs" buildings.

Build
Build is used to construct buildings, with a given submenu. If you want multiple sub menus, use multiple buildings.

type
The type of the command, in this case, build. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

build-skill
The name of the build skill to use.

buildings
List of buildings that could be built with this command. These units should all have "be_built" skills. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

start-sound
A list of sound files from which one will be randomly played whenever the unit starts building.

built-sound
A list of sound files from which one will be randomly played once the building is complete.

Harvest
Harvest commands are used for gathering resources, such as mining gold or chopping down trees.

type
The type of the command, in this case, harvest. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

harvest-skill
The name of the harvest skill to use.

stop-loaded-skill
The name of the stop skill to use when the unit stops after harvesting a full load. This is often different because they could be carrying the resource back.

move-loaded-skill
The name of the move skill to use when the unit moves after harvesting a full load. This is often different because they could be carrying the resource back.

harvested-resources
A list of the resources that the unit can harvest (only tech or tileset resources can be harvested).

max-load
Maximum number of the resource the unit can carry before it has to take it back to a building for storage.

hits-per-unit
The number of hits (skill cycles) that must be performed to get each unit of the resource.

Produce
The produce command is used to produce a new unit.

type
The type of the command, in this case, produce. The tip attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

produce-skill
The name of the produce skill to use.

produced-unit
The name of the unit to produce.

produced-units
An alternative method of supplying the unit to produce in GAE. The difference is that it makes a submenu like build would have. There should only be one of either produced-unit or produced-units. Another GAE only optional value shown here is number, which can appear in either &lt;produced-unit&gt; or &lt;produced-units&gt;</tt> style production commands, and allows multi-production, which produces the number specified when the production is complete. Note that only the resources of one of the produced units will be expended. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

Upgrade
The upgrade command is used to initiate an upgrade.

type
The type of the command, in this case, upgrade. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

upgrade-skill
The name of the upgrade skill to use.

produced-upgrade
The name of the upgrade to initiate.

produced-upgrades
GAE only alternative which allows multiple upgrades in a single command, which are condensed into one sub menu, like buildings use. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

Morph
Similar to the produce command, but instead of making a new unit, the morph command converts the current unit into the new one. A unit can have a maximum of six morph commands.

type
The type of the command, in this case, morph. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

morph-skill
The name of the morph skill to use.

morph-unit
The name of the unit to morph into.

morph-units
An alternative way of morphing units in GAE. The difference is that multiple units can be morphed by presenting a submenu like the one build uses. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

discount
The amount of the resources used to return after morphing, as a percentage from 0-100. 0 would mean you pay the full cost, 100 would mean that you are reimbursed the entire cost after morphing. Note that this is returned after morphing, so the initial resources are still needed.

cost-modifier
Works the same way as discount, but instead of refunding the resource after the morph (and thus requiring the full resources to start), it reduces the amount required to perform the morph, thus, you can start a morph with just enough resources for the cost-reduced morph.

finished-sound
A list of sound files, from which one is randomly selected, to play when the morphing is complete.

ignore-resource-requirements
If this optional MegaGlest only value is true, the resource requirements of the morphed unit will be ignored (in other words, a free morph). Defaults to false.

Attack
The attack command is used to attack a foe. Most of the information is stored in its linked skill.

type
The type of the command, in this case, attack. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

attack-skill
The name of the attack skill to use.

attack-skills
A GAE only alternative method of specifying the attack skill, this allows the attacks to be chosen based on the target. This uses a system of flags such as &lt;whenever-possible /&gt;</tt> or &lt;at-max-range /&gt;</tt> to specify circumstances in which to choose different skills. This is read from the top down (so the first one will be followed if the tag evaluates as true, even if the second one does too) and allows the AI to, for example, use a long ranged bow when the foe is far away, but otherwise use a short ranged sword.

Possible flags are: &lt;whenever-possible /&gt;</tt>, &lt;at-max-range /&gt;</tt>, &lt;on-large /&gt;</tt>, &lt;on-building /&gt;</tt>, and &lt;when-damaged /&gt;</tt>. The attack-skill value is the attack skill to use when that flag is active. There can be multiple flags per attack-skill.

Attack stopped
This is like an attack command, but instead of moving towards a foe, it stands still and attacks the foe when they are in range. This makes it useful for buildings which don't have a move skill, and for units in the form of a hold position command.

type
The type of the command, in this case, attack_stopped. The tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

stop-skill
The name of the stop skill to use.

attack-skill
The name of the attack skill to use.

attack-skills
A GAE only alternative method of specifying the attack skill, this allows the attacks to be chosen based on the target. This uses a system of flags such as &lt;whenever-possible /&gt;</tt> or <tt>&lt;at-max-range /&gt;</tt> to specify circumstances in which to choose different skills. This is read from the top down (so the first one will be followed if the tag evaluates as true, even if the second one does too) and allows the AI to, for example, use a long ranged bow when the foe is far away, but otherwise use a short ranged sword.

Possible flags are: <tt>&lt;whenever-possible /&gt;</tt>, <tt>&lt;at-max-range /&gt;</tt>, <tt>&lt;on-large /&gt;</tt>, <tt>&lt;on-building /&gt;</tt>, and <tt>&lt;when-damaged /&gt;</tt>. The attack-skill value is the attack skill to use when that flag is active. There can be multiple flags per attack-skill.

Guard
The guard command makes the unit follow an assigned unit, ready to attack.

type
The type of the command, in this case, guard. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

attack-skill
The name of the attack skill to use.

max-distance
The maximum distance from the guarded unit the guard can be. If too large, they might be too far away to see an attacker, but if too close, they might get in the way of the guarded unit.

attack-skills
A GAE only alternative method of specifying the attack skill, this allows the attacks to be chosen based on the target. This uses a system of flags such as <tt>&lt;whenever-possible /&gt;</tt> or <tt>&lt;at-max-range /&gt;</tt> to specify circumstances in which to choose different skills. This is read from the top down (so the first one will be followed if the tag evaluates as true, even if the second one does too) and allows the AI to, for example, use a long ranged bow when the foe is far away, but otherwise use a short ranged sword.

Possible flags are: <tt>&lt;whenever-possible /&gt;</tt>, <tt>&lt;at-max-range /&gt;</tt>, <tt>&lt;on-large /&gt;</tt>, <tt>&lt;on-building /&gt;</tt>, and <tt>&lt;when-damaged /&gt;</tt>. The attack-skill value is the attack skill to use when that flag is active. There can be multiple flags per attack-skill.

Patrol
With nearly the exact same syntax as the guard command, patrol has a unit move between its position and its target, ready to attack. If the target is a unit, it will continiously move to the unit's current location. If that unit dies, it will go to where it last was.

type
The type of the command, in this case, patrol. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

attack-skill
The name of the attack skill to use.

max-distance
The maximum distance from the patrol location the unit can go. If it's too high, the unit might not patrol tightly enough, but too low and they can get blocked or in the way of others (if patrolling to another unit).

attack-skills
A GAE only alternative method of specifying the attack skill, this allows the attacks to be chosen based on the target. This uses a system of flags such as <tt>&lt;whenever-possible /&gt;</tt> or <tt>&lt;at-max-range /&gt;</tt> to specify circumstances in which to choose different skills. This is read from the top down (so the first one will be followed if the tag evaluates as true, even if the second one does too) and allows the AI to, for example, use a long ranged bow when the foe is far away, but otherwise use a short ranged sword.

Possible flags are: <tt>&lt;whenever-possible /&gt;</tt>, <tt>&lt;at-max-range /&gt;</tt>, <tt>&lt;on-large /&gt;</tt>, <tt>&lt;on-building /&gt;</tt>, and <tt>&lt;when-damaged /&gt;</tt>. The attack-skill value is the attack skill to use when that flag is active. There can be multiple flags per attack-skill.

Generate
Generate is a command for creating static or consumable resources without having to produce an actual unit.

type
The type of the command, in this case, generate. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

produce-skill
The name of the produce skill to use.

finished-sound
A list of sound files, from which one is randomly selected, to play when the skill is complete.

produced
A special tag to sum up the production. Inside we declare the name of what we are producing, which can be any valid variable, we give the path to a bitmap image for the generated thing, as well as a cancel image to cancel the generation. Unit-requirements, upgrade-requirements, and resource-requirements are all the same as you'd see in a Unit XML.

Cast-spell
Cast spell is a command to allow a friendly spell to be casted on either yourself or a target.

type
The type of the command, in this case, cast-spell. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

cast-spell-skill
The name of the cast-spell skill to use.

affect
Who the command is used against. Either <tt>self</tt> for casting spells on yourself, such as a self-buffing spell, or <tt>target</tt> to cast spells on others, such as a healing spell.

cycle
Whether or not the command loops. If true, it will repeat the spell over and over, if false, it casts once per click. Note that since it considers the cycle done when the skill cycle is up, the speed and anim speed in the skill must be the same!

Teleport
Teleport is a method of moving instantly from one location to another, unblocked by anything in the way (though the destination must be clear).

type
The type of the command, in this case, teleport. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

build-self
Build self is a way of finishing a building by itself, without any other units repairing or building it. Note that the skill is "build_self" while the command is "build-self".

type
The type of the command, in this case, build-self. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

build-self-skill
The name of the build_self skill to use.

display
If true, a button is shown and must be clicked in order to perform the self building. If false, it's done automatically.

Load
Load is one of the skills needed, along with unload, to make a transport or garrisoning building. It allows a unit to be loaded or "carried".

type
The type of the command, in this case, load. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

load-skill
The name of the load skill to use.

move-skill
The name of the move skill to use.

units-carries
A list of the units that are able to be loaded.

load-capacity
The maximum number of units that the unit can hold.

allow-projectiles
If true, units can fire out of the loader. The horizontal and vertical offset is the offset to where the particles would start.

Unload
The opposite of load, unload will remove the previously loaded units, one by one.

type
The type of the command, in this case, unload. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

move-skill
The name of the move skill to use.

Transform
Transform works like morph, but instead of morphing into a similar mobile unit, it can be used for morphing into buildings.

type
The type of the command, in this case, build-self. The <tt>tip</tt> attribute is an optional GAE-only value that will reference the keyword used as a tooltip.

name
The name of the command, as seen ingame. GAE can translate these with separate language files as well.

image
Path to the image which will be used as an icon to initiate the command.

unit-requirements
A list of units that must exist before this command can be used. For example, you might have to construct a testing lab before you can start throwing grenades.

upgrade-requirements
A list of upgrades that must exist before this command can be used. For example, you might have to perform a training field upgrade before you could use a more advanced skill.

morph-skill
Name of the morph skill.

move-skill
Name of the move skill.

position
Allows the position of where the building will be placed relative to the unit to be tweaked.

rotation
Allows the rotation of building, in degrees, to be tweaked. 0 is facing north.

morph-units
A list of the units that can be morphed into.

hp-policy
Either <tt>set-to-one</tt> (the new building will have 1 HP), <tt>reset</tt> (use the default behaviour, the new building will have 5% of max HP), or <tt>maintain</tt> (keep the original unit's HP, clamped to the new unit's max HP).