From MegaGlest
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.

Skills XML[edit]

The XML tags are divided into two parts, skills and commands, of which both are required for the feature to function.

	<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"/>
	<max-range value="3"/>

	<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"/>
	<max-range value="2"/>

Skills Elements[edit]

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.


This defines the type of the skill, in this case, load or unload.


The name the skill is referenced in commands by, can be any valid variable name (starts with a letter, can contain letters, numbers, dashes, or underscores).


How much EP the skill will require for each cycle. If there isn't enough EP, the skill cannot be executed.


The speed that skill cycles at. Higher numbers make the skill go faster. The time it takes to perform a standard skill cycle can be found via the skill cycle formula.


The speed to play the animation at. G3DHack is capable of setting an anim-speed for testing to find the perfect speed. Note that the anim-speed should generally be a lower number than the speed, otherwise the skill cycle will be repeated multiple times for a single animation.


The path to the G3D model that will be used when the unit is performing the skill.


If true, randomly plays one of the listed sound files every time a skill cycle commences. There can be any number of sound files, and only one will be played each time, though the choice of which is random. The path is a relative path to the sound file, which can be either OGG or WAV.


Maximum distance the unit can be from the transport to be loaded. Too large and the unit will seem to disappear before it reaches the transport, too short and it large size units may have trouble accessing it.


If true, the unit will emit particles via a unit particle system. This is applied on a per skill basis, so if you want them to always be emitting the same particles, give them the same tags on every skill, except possibly be_built and die. You could also change the particles to modify the unit's appearance while doing a certain skill. For example, black smoke might turn fiery when a building is producing. There can be as many particle systems on a skill as you want, and each is placed by giving a particle-file tag the relative path of a Unit Particle XML.

Commands XML[edit]

	<type value="load"/>
	<name value="load"/>
	<image path="images/transport_load.bmp"/>
	<load-skill value="load_skill"/>
	<move-skill value="move_skill"/>
		<unit value="unit"/>
	<load-capacity value="6" />
	<allow-projectiles value="true">
		<horizontal-offset value="2.0" />
		<vertical-offset value="1.5" />

	<type value="unload"/>
	<name value="unload"/>
	<image path="images/transport_unload.bmp"/>
	<unload-skill value="unload_skill"/>

Commands Elements[edit]


The type of the command, in this case, load or unload.


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


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


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.


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.


The name of the load skill to use.


The name of the move skill to use.


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


The maximum number of units that the unit can hold.


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 to start projectiles.


Vertical offset to start projectiles.

See also[edit]