A pet is a unit that will guard their master when idle, will attack the position of their master and will die when their master dies. The restriction on the number of pets a unit can have is specified in the produce skill. Each maximum pet restriction applies to the unit type of the pet, not the total number of pets.
XML[]
<skill>
<type value="produce"/>
<name value="summon_pet"/>
<ep-cost value="5"/>
<speed value="75"/>
<anim-speed value="100"/>
<animation path="animation.g3d"/>
<animation-random-cycle-maxcount value="1" />
<sound enabled="true" start-time="0.3">
<sound-file path="sound.wav"/>
</sound>
<pet value="true" max="4"/>
<particles value="true">
<particle-file path="unit_particle_system.xml"/>
</particles>
</skill>
Elements[]
type[]
This defines the type of the skill, in this case, produce.
name[]
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).
hp-cost[]
A MegaGlest only feature which allows a certain amount of HP to be depleted each time this skill is used (per skill cycle). This is currently broken.
ep-cost[]
How much EP the skill will require for each cycle. If there isn't enough EP, the skill cannot be executed.
speed[]
The speed that skill cycles at. Higher numbers make the skill go faster. The time it takes is dependant on the producee's time parameter, and uses the formula below.
anim-speed[]
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.
animation[]
The path to the G3D model that will be used when the unit is performing the skill. In MegaGlest, there can be multiples of this tag, and one will be chosen at random. You can also force a certain animation to be used when the unit's HP is between certain values with the minHp and maxHp attributes. For example, <animation path="model.g3d" minHp="0" maxHp="100" /> would force the animation model.g3d to be used when the unit's HP is between zero and 100.
animation-random-cycle-maxcount[]
This optional, MegaGlest only node tells the engine to cycle through the maximum specified random models. This is useful for death animations, where it can pick a random one but won't switch to another after it finishes animating. If this node does not exist the engine assume no maximum. Generally, it's only used for "one time" skills such as death or morph, while other skills would not not use the tag at all.
sound[]
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.
pet[]
This is the tag that disambiguates pets from regular units. By having it true, the unit will be a pet. The max attribute is the maximum number of that pet each master can have.
particles[]
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.
Limitations[]
You can currently only specify a maximum number of each individual type of pet, not a limitation on the total number of pets, as a whole.