GAE/Command XML

= Common Command Elements =

type
This tells the engine what sort of command this is, and must by one of 'stop', 'move', 'attack', 'attack-stopped', 'build', 'harvest', 'repair', 'produce', 'generate', 'upgrade', 'morph', 'cast-spell', 'guard', 'patrol', 'load' or 'unload'

name
This is a name you give to identify the command. This name is displayed on the display panel if a single unit is selected and is executing this command.

image
Must be a path to an image file, used as the 'icon' for this command.

unit-requirements & upgrade-requirements
Container elements specifying what other units and upgrades the faction must have produced before this command can be executed. See Requirable type.

= Commands By Type =

stop
Specific Elements: 

The stop command is executed when a unit has no other commands.    

move
Specific Elements: 

The move command allows a unit to move to a specific location.

   

produce
Specific Elements:  &lt;!-- required --&gt;  &lt;!-- optional --&gt;    and either,  &lt;!-- For single click produce commands --&gt; Or, <produced-units> &lt;!-- For two click produce commands --&gt; <produced-unit name="my_unit" /> <produced-unit name="other_unit" /> &lt;!-- etc --&gt; </produced-units>

The produce command creates new units, while this command is being executed a production counter is maintained, each completed skill cycle of the supplied produce-skill adds one to the counter, when the counter reaches the value in the time paramater of the unit being produced the new unit is created. GAE 0.3 adds the ability to specify 'two-click' commands, that work much like the build command, giving a 'sub-menu' to select from multiple unit types.

Single click version: <name value="produce_warrior" /> <image path="images/warrior.bmp"/> <unit-requirements /> <upgrade-requirements /> <produce-skill value="produce_skill"/> <produced-unit name="warrior"/>

Two click version: <name value="produce_warrior" /> <image path="images/produce_warrior.bmp"/> <unit-requirements /> <upgrade-requirements /> <produce-skill value="produce_skill"/> <produced-units> <produced-unit name="swordsman"/> <produced-unit name="pikeman"/> <produced-unit name="knight"/> </produced-units>

generate
Specific Elements: <produce-skill value="produce_skill" /> &lt;!-- required --&gt;      &lt;!-- optional --&gt; &lt;!-- required --&gt; &lt;!-- see Producible type --&gt;

The generate command can be used to produce non-unit producibles. Its purpose is mainly to generate static or consumable resources. The same 'production point' system as with produce is used.

<name value="make_mana" /> <image path="images/make_mana.bmp"/> <unit-requirements /> <upgrade-requirements /> <produce-skill value="produce_skill"/> <name value="10_mana" /> <image path="images/10_mana.bmp"/> <image-cancel path="images/cancel.bmp"/> <unit-requirements/> <upgrade-requirements/> <resource-requirements> <resource name="gold" amount="100"/> <resource name="stone" amount="40"/> <resource name="energy" amount="-10"/> </resource-requirements>

upgrade
Specific Elements: <upgrade-skill value="upgrade_skill" /> &lt;!-- required --&gt; <produced-upgrade name="upgrade_name" /> &lt;!-- required --&gt;  &lt;!-- optional --&gt;

Researches an upgrade. The same production point system as with produce is used.

<name value="research_upgrade1"/> <image path="images/upgrade1.bmp" /> <unit-requirements/> <upgrade-requirements/> <upgrade-skill value="upgrade_skill"/> <produced-upgrade name="upgrade1"/>

morph
Specific Elements: <morph-skill value="morph_skill" /> &lt;!-- required --&gt; &lt;!-- required --&gt;  &lt;!-- optional --&gt; and either, <morph-unit name="my_unit" /> &lt;!-- For single click morph commands --&gt; Or, <morph-units> &lt;!-- For two click morph commands --&gt; <morph-unit name="my_unit" /> <morph-unit name="other_unit" /> &lt;!-- etc --&gt; </morph-units>

This command changes a unit's type, the production point system as described earlier determines how long this takes, controlled by the morph-unit 'time' and the morph-skill 'speed'. As with the produce command, GAE 0.3 introduces support for two-click versions.

The discount paramter is a percentage of the resource costs of the morph-unit to refund after the morph is complete. Consumable resources are never discounted, and only positive costs will be refunded for tech or tileset resources. Static resources will always be refunded (positive or negative cost)

<name value="change_me"/> <image path="images/morph.bmp"/> <unit-requirements/> <upgrade-requirements/> <morph-skill value="morph_skill"/> <morph-unit name= "unit_b"/>

load
Specific Elements: <move-skill value="move_skill" /> &lt;!-- optional --&gt; <load-skill value="load_skill" /> &lt;!-- required --&gt; <units-carried>                  &lt;!-- required --&gt; <unit value="unit_a" /> <unit value="unit_b" /> </units-carried> <load-capacity value="6" />      &lt;!-- required --&gt; <allow-projectiles value="true"> &lt;!-- optional, default value = 'false' --&gt; <horizontal-offset value="2.0" /> &lt;!-- Horizontal offset to start projectiles --&gt; <vertical-offset value="1.5" />   &lt;!-- vertical offset to start projectiles --&gt; </allow-projectiles>

The load command is used to load other units into this unit, a load skill is required, and a move skill is optional. If a move skill is supplied the unit will move towards units it has been asked to load, if not it will wait for them to come to it.

The units-carried node provides a list of units that can be loaded, and the load-capacity sets a limit on how many units can be loaded.

If allow-projectiles is true then a vertical and horizontal offset must be provided, as of 0.3.1 you can not precisely locate projectile start positions, they will originate from a random position on a 'ring' defined by the vertical offset, and the horizontal offset at a random angle.

<image path="images/transport_load.bmp"/> <unit-requirements/> <upgrade-requirements/> <load-skill value="load_skill"/> <move-skill value="move_skill"/> <units-carried> </units-carried> <load-capacity value="6" />

unload
Specific Elements: <move-skill value="move_skill" />  &lt;!-- optional --&gt; <unload-skill value="load_skill" /> &lt;!-- required --&gt;

The unload command is used to unload housed units, if a move skill is provided then it is a two click order, so to unload you select unload, select a position, then the transport will move to that position and then unload. If no move skill is provided it is a one click order, housed units will be unloaded immediately.

Units can also be unloaded individually by double clicking their portraits on the display panel.

<image path="images/transport_unload.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="unload_skill"/>

build
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt; <build-skill value="build_skill" /> &lt;!-- required --&gt; &lt;!-- required --&gt; <building name="unit_a" /> <building name="unit_b" /> &lt;!-- etc --&gt; <start-sound enabled="true"> <sound-file path="sounds/build_start.wav" /> </start-sound> <built-sound enabled="true"> <sound-file path="sounds/build_finish.wav" /> </built-sound>

The build command is used to construct other units (which are buildings, as defined by whether they have a be-built skill or not).

<name value="build_basic"/> <image path="images/build.bmp"/> <unit-requirements/> <upgrade-requirements/> <build-skill value="build_skill"/> <start-sound enabled="false" /> <built-sound enabled="false" />

repair
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt; <repair-skill value="repair_skill" /> &lt;!-- required --&gt; <repaired-units>                        &lt;!-- required --&gt; <unit name="unit_a" /> <unit name="unit_b" /> &lt;!-- etc --&gt; </repaired-units>

The repair command is used to restore hp to other units. The repair skill determines the rate.

<image path="images/repair.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="move_skill"/> <repair-skill value="repair_skill"/> <repaired-units> </repaired-units>

harvest
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt; <harvest-skill value="harvest_skill" /> &lt;!-- required --&gt; <move-loaded-skill value="move_loaded_skill" />  &lt;!-- required --&gt; <stop-loaded-skill value="stop_loaded_skill" /> &lt;!-- required --&gt; <harvested-resources>                        &lt;!-- required --&gt; &lt;!-- etc --&gt; </harvested-resources> <max-load value="20">                     &lt;!-- required --&gt; <hits-per-unit value="1">                 &lt;!-- required --&gt;

The harvest command is used to extract the tech and tileset ressources. The skill speed in combination with hits-per-unit controls the rate of harvesting.

<image path="images/harvest.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="move_skill"/> <harvest-skill value="harvest_skill"/> <move-loaded-skill value="move_loaded_skill"/> <stop-loaded-skill value="stop_loaded_skill"/> <harvested-resources> </harvested-resources> <max-load value="25"> <hits-per-unit value="1">

= Common Attack Command Elements =

attack-skill
Specifies a single attack-skill for this command to use. If an attack-skill element is present, any attack-skills element will be ignored.

<attack-skill value="attack_ranged"/>

attack-skills
Is used to specify a set of attack-skills this command can use, and allows some flags to be used to help the unit decide when to use each. The flags supported are 'whenever-possible', 'at-max-range', 'on-large', 'on-building' & 'when-damaged'.

<attack-skills> <attack-skill value="attack_ranged"> <at-max-range /> </attack-skill> <attack-skill value="attack_melee"> <whenever-possible /> </attack-skill> </attack-skills>

= Attack Commands By Type =

attack
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt;

A simple attack command for mobile units.

<image path="images/attack.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="move_skill"/> <attack-skill value="attack_skill"/>

attack-stopped
Specific Elements: <stop-skill value="stop_skill" />  &lt;!-- required --&gt;

An attack command where the unit attacking does not move, can be used for buildings or to implement a 'hold-position' command for mobile units.

<type value="attack-stopped"/> <name value="hold_position"/> <image path="images/hold_pos.bmp"/> <unit-requirements/> <upgrade-requirements/> <stop-skill value="stop_skill"/> <attack-skill value="attack_skill"/>

patrol
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt;

Used to set a patrol route for a unit, the unit will travel alternately between its start location (where it was when the order was given), and the position (or unit) selected.

<image path="images/attack.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="move_skill"/> <attack-skills> <attack-skill value="attack_ranged"> <at-max-range /> </attack-skill> <attack-skill value="attack_melee"> <on-large /> </attack-skill> </attack-skills>

guard
Specific Elements: <move-skill value="move_skill" />  &lt;!-- required --&gt; <max-distance value="4" />

This command is used to order one unit to guard another (or a location), if guarding a target unit, the unit will move towards the target if it is more than max-distance away.

<image path="images/attack.bmp"/> <unit-requirements/> <upgrade-requirements/> <move-skill value="move_skill"/> <attack-skill value="attack_skill"/> <max-distance value="4" />