GAE/Command XML

From MegaGlest
Revision as of 08:52, 14 September 2010 by Silnarm (talk) (Commands page, about half done...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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

A container specifying what other units the faction must have produced before this command can be executed.

upgrade-requirement

A container specifying what upgrades must be researched before this command is made available.

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

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>