Skip to content

BarrelAnimIsVoxel

Draws a building's gun barrel from a voxel model over its turret animation.

Specification
Applies to
BuildingType
File
rules.ini
Section
[<ObjectType ID>]
Value
boolean
When omitted
no

Set, the turret stays an animation and the barrel becomes a voxel model drawn over it. The model — VoxelBarrelFile, or a name derived from TurretAnim — is placed each frame by the four barrel pivot offsets and VoxelBarrelScale, turned to the building’s facing and elevated to the barrel’s pitch.

rules.ini
[MYARTILLERY] ; a BuildingType registered in [BuildingTypes]
Turret=yes
TurretAnim=MYART_A ; an AnimType registered in [Animations]
BarrelAnimIsVoxel=yes
VoxelBarrelFile=MYARTBAR
VoxelBarrelOffsetToBuildingPivotPoint=4,2,3
VoxelBarrelOffsetToRotatePivotPoint=2,0,0
VoxelBarrelOffsetToPitchPivotPoint=15,0,-8
VoxelBarrelOffsetToBarrelEnd=350,75,0

The building draws that turret animation itself rather than leaving it to the layer, so the two keep their order as the gun swings: the barrel is drawn over the animation while the gun points anywhere from north-east round through south to south-west, and under it across the rest of the circle. The barrel is written into the depth buffer at a fixed bias of 15 pixels in front, whatever TurretAnimZAdjust says.

Both the mounting and the muzzle move to the end of the barrel, which VoxelBarrelOffsetToBarrelEnd covers, in place of the firing offsets PrimaryFireFLH supplies.