GAE/Transports

From MegaGlest
Revision as of 07:03, 27 April 2011 by Hofmic (talk) (Created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Loading and unloading skills and commands allow transports and garrisoning to be possible. They let units be loaded (or "carried") by another. Carrier units are extremely versatile. You can have transportation ships to carry land units across bodies of water, defense towers which can be mounted by archers, tanks with gunners, etc.

XML

<skill>
   <type value="load"/>
   <name value="load_skill"/>
   <ep-cost value="0"/>
   <speed value="120"/>
   <anim-speed value="120"/>
   <animation path="models/transport_loading.g3d"/>
   <sound enabled="true" start-time="0">
     <sound-file path="sounds/transport_load.wav"/>
   </sound>
   <max-range value="3"/>
</skill>

<skill>
   <type value="unload"/>
   <name value="unload_skill"/>
   <ep-cost value="0"/>
   <speed value="120"/>
   <anim-speed value="120"/>
   <animation path="models/transport_unloading.g3d"/>
   <sound enabled="true" start-time="0">
     <sound-file path="sounds/transport_unload.wav"/>
   </sound>
   <max-range value="2"/>
</skill>

<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="unit"/>
   </units-carried>
   <load-capacity value="6" />
   <allow-projectiles value="true">
      <horizontal-offset value="2.0" />
      <vertical-offset value="1.5" />
   </allow-projectiles>
</command>

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

Elements

For the most part, the load and unload commands resemble your standard commands. Move skills are optional, and can be excluded from buildings. 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.

speed

Because only one unit can be loaded/unloaded per cycle, the speed determines how fast units are loaded and unloaded.

max-range

Maximum range a unit can be from the carrier before it can be loaded or the maximum distance away it will be placed after being unloaded.

units-carried

This lists the units that can be loaded by the carrier unit.

load-capacity

The maximum number of units that can be loaded into the carrier unit.

allow-projectiles

If true, ranged units can fire their projectiles from this unit, even while moving. Useful for garrisoning units, armoured vehicles, etc. If allow-projectiles is true then a vertical and horizontal offset must be provided. The projectiles will originate from a random position on a 'ring' defined by the vertical offset, and the horizontal offset at a random angle.

horizontal-offset

Horizontal offset to start projectiles.

vertical-offset

Vertical offset to start projectiles.

See also