TurretAnim
The animation a building's turret is drawn from, or the voxel model that replaces it.
- Applies to
- BuildingType
- File
rules.ini- Section
[<ObjectType ID>]- Value
- string
- When omitted
(empty)
Unless TurretAnimIsVoxel=yes is set, the value is an AnimType ID. The animation is drawn at the offset TurretAnimX and TurretAnimY give.
A Turret=yes or ChargeAnim=yes building starts the animation when its construction finishes. TurretAnimIsExclusive=yes holds it back until the weapon charges. Every game frame, the building then picks the animation’s frame:
- A
Turret=yesbuilding shows the frame for the direction its turret points, one of 32. - A
ChargeAnim=yesbuilding shows the frame its charge has reached instead.
A building whose primary weapon is Charges=yes also starts the animation each time it begins to charge.
Voxel turrets and barrels
Section titled “Voxel turrets and barrels”With TurretAnimIsVoxel=yes, the value is a voxel base name and no animation is started. With BarrelAnimIsVoxel=yes alone, the value stays an AnimType ID and the animation still runs; the building draws it in front of or behind its voxel barrel.
Under either flag, the engine loads models named after the value. Each model is a .VXL file with the .HVA file of the same name beside it.
- The engine looks for
TURin the value, starting at the fifth character. ATURin the first four characters does not count. - If it finds one, it loads
<name>.VXLas the turret model. The barrel model’s name is the value with thatTURand everything after it replaced byBARL, andVoxelBarrelFileis not read. - If it finds none, it loads no turret model. A
BarrelAnimIsVoxel=yesbuilding takes its barrel model fromVoxelBarrelFile. Otherwise the barrel model is<name>.VXL, which aTurretAnimIsVoxel=yesbuilding draws as one piece that both turns and elevates.
[MYTOWER] ; a BuildingType registered in [BuildingTypes]Turret=yesTurretAnimIsVoxel=yesTurretAnim=MYTWRTUR ; drawn from MYTWRTUR.VXL, its barrel from MYTWRBARL.VXLWall towers
Section titled “Wall towers”The building named by WallTower starts with this animation like any other. Fitting a plug replaces it with a lettered animation: the tower’s Image ID with _B, _C or _D appended. The letter follows the number of upgrade levels the tower’s plugs have filled, which PowersUpToLevel sets. One level gives _B, two give _C and three give _D.
When the tower’s health falls to ConditionYellow or below, TurretAnimDamaged replaces the animation showing. When repairs lift it back above, TurretAnim replaces it. Each replacement happens only when that key names a registered AnimType; otherwise the lettered animation stays.
Once replaced, the lettered animation comes back only when another plug is fitted. Removing a Turret=yes plug leaves the tower with no turret animation until another plug is fitted.
TurretAnimDamaged, TurretAnimIsVoxel, BarrelAnimIsVoxel, VoxelBarrelFile, TurretAnimX, Turret