Animation-CobCallins

From Spring
Revision as of 21:26, 27 May 2008 by Evil4Zerggin (talk | contribs)
Jump to navigationJump to search

Source

Callins are listed near the end of this file: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobFile.cpp

Callins

General

Create()

Called when the unit is created (not finished).

Activate()/Deactivate()

Called when the unit is turned on/off.

Killed(severity, corpsetype)

Called when the unit is killed. Severity indicates how many percent of the unit's hit points were dealt by the final blow. Corpsetype basically indicates the number of times the unit and its corpses are destroyed; for example, corpsetype = 3 acts as if the unit is destroyed, the corpse is destroyed, and the corpse's corpse is destroyed. If it runs out of corpses nothing is left behind.

Movement

StartMoving()/StopMoving()

Called when the unit starts/stops moving. This includes rotation, so don't be surprised if StartMoving() sometimes gets called when a unit starts aiming at a target.

SetSFXOccupy(terraintype)

Supposedly called when the unit changes terrain type, although it didn't work last time I tried it? Maybe I was using it wrong. terraintype: 0 = transported, 1 = sea, 2 = deep sea (greater than 5 water depth and unit is upright), 4 = land.

SetDirection(direction)

Used only for wind generators. Gives the direction of the wind.

SetSpeed(speed)

Used for wind generators, tidals, and mexes. Basically more resources = higher speed.

Weapons

For weapons, X means either the number of the weapon, or "Primary", "Secondary", or "Tertiary". I recommend using numbers wherever possible.

AimWeaponX(heading, pitch)

Called every ~0.5s when the unit is aiming the weapon at a target. This is used to turn a unit's turrets toward the target. Return 1 when the weapon is ready to fire. Alternately, return 0 if you don't want the weapon to fire (you can use this to disable weapons).

FireWeaponX()

Called whenever the trigger is pulled on a weapon. This occurs before the first shot in a burst (only).

ShotX()

Called before every shot a weapon fires. This includes burst and projectile tags. This happens after FireWeaponX(), even for the first shot.