GAE/Command XML

From MegaGlest
Revision as of 18:12, 23 May 2011 by 174.117.233.162 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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'

<type value="stop"/>

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.

<name value="stop"/>

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:

<stop-skill value="stop_skill" />

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

<command>
   <type value="stop"/>
   <name value="stop"/>
   <image path="images/stop_icon.bmp"/>
   <unit-requirements/>
   <upgrade-requirements/>
   <stop-skill value="stop_skill"/>
</command>

move

Specific Elements:

<move-skill value="move_skill" />

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

<command>
   <type value="move"/>
   <name value="move"/>
   <image path="images/move_icon.bmp"/>
   <unit-requirements/>
   <upgrade-requirements/>
   <move-skill value="move_skill"/>
</command>

produce

Specific Elements:

<produce-skill value="produce_skill" /> <!-- required -->
<finished-sound enabled="true"> <!-- optional -->
   <sound-file path="sounds/produce_finished1.wav" />
   <sound-file path="sounds/produce_finished2.wav" />
</finished-sound>

and either,

<produced-unit name="my_unit" /> <!-- For single click produce commands -->

Or,

<produced-units> <!-- For two click produce commands -->
   <produced-unit name="my_unit" />
   <produced-unit name="other_unit" />
   <!-- etc -->
</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:

<command>
   <type value="produce"/>
   <name value="produce_warrior" />
   <image path="images/warrior.bmp"/>
   <unit-requirements />
   <upgrade-requirements />
   <produce-skill value="produce_skill"/>
   <produced-unit name="warrior"/>
</command>

Two click version:

<command>
   <type value="produce"/>
   <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>
</command>

generate

Specific Elements:

<produce-skill value="produce_skill" /> <!-- required -->
<finished-sound enabled="false" />      <!-- optional -->
<produced> <!-- required -->
   <!-- see Producible type -->
</produced>

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.

<command>
   <type value="generate"/>
   <name value="make_mana" />
   <image path="images/make_mana.bmp"/>
   <unit-requirements />
   <upgrade-requirements />
   <produce-skill value="produce_skill"/>
   <produced>
      <name value="10_mana" />
      

upgrade

Specific Elements:

<upgrade-skill value="upgrade_skill" />  <!-- required -->
<produced-upgrade name="upgrade_name" /> <!-- required -->
<finished-sound enabled="false" /> <!-- optional -->

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

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

morph

Specific Elements:

<morph-skill value="morph_skill" /> <!-- required -->
<discount value="0"/>               <!-- required -->
<finished-sound enabled="false" />  <!-- optional -->

and either,

<morph-unit name="my_unit" /> <!-- For single click morph commands -->

Or,

<morph-units> <!-- For two click morph commands -->
   <morph-unit name="my_unit" />
   <morph-unit name="other_unit" />
   <!-- etc -->
</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)

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

load

Specific Elements:

<move-skill value="move_skill" /> <!-- optional -->
<load-skill value="load_skill" /> <!-- required -->
<units-carried>                   <!-- required -->
   <unit value="unit_a" />
   <unit value="unit_b" />
</units-carried>
<load-capacity value="6" />       <!-- required -->
<allow-projectiles value="true">  <!-- optional, default value = 'false' -->
   <horizontal-offset value="2.0" />  <!-- Horizontal offset to start projectiles -->
   <vertical-offset value="1.5" />    <!-- vertical offset to start projectiles -->
</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.

<command>
   <type value="load"/>
   <name value="load"/>
   <image path="images/transport_load.bmp"/>
   <unit-requirements/>
   <upgrade-requirements/>
   <load-skill value="load_skill"/>
   <move-skill value="move_skill"/>
   <units-carried>
      <unit value="infantry"/>
      <unit value="marine"/>
      <unit value="medic"/>
      <unit value="engineer"/>
   </units-carried>
   <load-capacity value="6" />
</command>

unload

Specific Elements:

<move-skill value="move_skill" />   <!-- optional -->
<unload-skill value="load_skill" /> <!-- required -->

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.

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

build

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->
<build-skill value="build_skill" /> <!-- required -->
<buildings>                         <!-- required -->
   <building name="unit_a" />
   <building name="unit_b" />
   <!-- etc -->
</buildings>
<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).

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

repair

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->
<repair-skill value="repair_skill" /> <!-- required -->
<repaired-units>                         <!-- required -->
   <unit name="unit_a" />
   <unit name="unit_b" />
   <!-- etc -->
</repaired-units>

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

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

harvest

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->
<harvest-skill value="harvest_skill" /> <!-- required -->
<move-loaded-skill value="move_loaded_skill" />   <!-- required -->
<stop-loaded-skill value="stop_loaded_skill" /> <!-- required -->
<harvested-resources>                         <!-- required -->
   <resource name="gold" />
   <!-- etc -->
</harvested-resources>
<max-load value="20">                      <!-- required -->
<hits-per-unit value="1">                  <!-- required -->

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.

<command>
   <type value="harvest"/>
   <name value="harvest"/>
   <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>
      <resource name="gold" />
      <resource name="stone" />
   </harvested-resources>
   <max-load value="25">
   <hits-per-unit value="1">
</command>

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">
      <flags>
         <at-max-range />
      </flags>
   </attack-skill>
   <attack-skill value="attack_melee">
      <flags>
         <whenever-possible />
      </flags>
   </attack-skill>
</attack-skills>

Attack Commands By Type

attack

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->

A simple attack command for mobile units.

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

attack-stopped

Specific Elements:

<stop-skill value="stop_skill" />   <!-- required -->

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.

<command>
   <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"/> 
</command>

patrol

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->

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.

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

guard

Specific Elements:

<move-skill value="move_skill" />   <!-- required -->
<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.

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