Messages Turret - themeldingwars/Documentation GitHub Wiki

Turret messages mirror the Character combat ones almost exactly, which makes sense given a manned turret is a weapon the player is driving. Where the behaviour is the same, the Character page is the fuller description.

Commands

Sent by the client on the Turret BaseController.

PoseUpdate

  • A quaternion and a uint32 time.
  • The turret equivalent of the Character MovementInput: it is the only thing a turret can "move", so aiming it is the whole pose.

FireBurst

  • A quaternion and a uint32 time.
  • Sent when the player presses fire. Unlike the Character version this one carries the aim with it rather than relying on a separate pose update.

FireEnd

  • A uint32 time.
  • Sent when the player releases fire.

FireWeaponProjectile

  • A uint32 time, an aim vector, and an optional second vector behind a HaveMoreData byte.
  • Sent when the local weapon simulation believes a new projectile should exist. The server can turn this into WeaponProjectileFired for the remote Turret ObserverView.

ReportProjectileHit

  • Sent when the local projectile simulation believes a projectile has hit something.
  • Contents: a ushort trace ref (the low half of the id used to group traces in a debugweapon trace), a ushort short time, a byte that is usually 1, the hit direction quantised into three sbytes, a half float distance along the ray, and a ushort physics material id taken from the userdata of the ragdoll part that was hit.
  • The same caveats as the Character version apply: it does not identify the target directly and does not always trigger.

Events

Sent by the server on the Turret ObserverView.

WeaponProjectileFired

  • Identical contents to FireWeaponProjectile: time, aim, and an optional second vector.
  • This is how everyone other than the shooter learns that the turret fired.