Skip to content

five-on-it / packages/protocol/src/messages / EntitySnapshot

Interface: EntitySnapshot ​

Defined in: packages/protocol/src/messages.ts:141

One replicated entity inside a snapshot: a vehicle, a trailer, a character, a projectile, a light piece of the level lying loose, a door of the level, items lying on the ground (item), a container (a crate, a locker), a terminal (a kiosk, a keypad, an ATM, a vending machine), a security camera of the level or a nail strip laid on a road (nails, its pose turned to the heading it stops).

Properties ​

act ​

act: number

Defined in: packages/protocol/src/messages.ts:251

What a character on foot does with its hands, for the renderers (the simulation's actByte): the act's index in its ACTS in the low five bits (a shot, a punch, a pickup, a door, the phone out, a lock picked…), a counter of its acts in the high three; seated, a shot from the seat only (seatedActByte); 0 for anything else.


aim ​

aim: number

Defined in: packages/protocol/src/messages.ts:180

Where a character aims (rad).


alert ​

alert: number

Defined in: packages/protocol/src/messages.ts:227

An NPC's alert (stealth: GAME_DESIGN §8): 0 for none (a player, a pedestrian, a chaser), else 1 + its phase's rank: 1 normal, 2 caution, 3 suspicious ("?"), 4 search, 5 alert ("!").


boost ​

boost: number

Defined in: packages/protocol/src/messages.ts:168

Boost meter, 0..1; for a character, how far it has picked a car's lock, 0..1.


boostSpent ​

boostSpent: boolean

Defined in: packages/protocol/src/messages.ts:170

The boost ran its meter dry while still held and waits for a new double tap.


burning ​

burning: boolean

Defined in: packages/protocol/src/messages.ts:218

A vehicle on fire: burning toward its blast, or its wreck still burning after it (the simulation's fire.ts).


cls ​

cls: number

Defined in: packages/protocol/src/messages.ts:186

Index of the car's class in the simulation's class table (size, drivetrain, tuning); a trailer carries its tractor's; for a character, a pedestrian's role (the simulation's PEDESTRIAN_ROLES, 0 for anyone else; the last of them, its DOG_ROLE, is a dog, in a dog's body) or, from the simulation's ROLE_CLS_BASE up, a character's role (a contact who talks); an item's index in the room's items (the welcome's); a container's or a terminal's kind; a door's lock (1 a key's, 2 a keypad's); a camera's state (0 on, 1 off, 2 destroyed).


cooking ​

cooking: number

Defined in: packages/protocol/src/messages.ts:200

Ticks a character has held a grenade with its pin out (0 = none): the fuse runs from there.


cover ​

cover: number

Defined in: packages/protocol/src/messages.ts:194

A character's cover: 0 in the open, 1 hidden behind it, 2 popped up out of it.


coverLow ​

coverLow: boolean

Defined in: packages/protocol/src/messages.ts:196

The character's cover is low (hidden means crouching).


coverYaw ​

coverYaw: number

Defined in: packages/protocol/src/messages.ts:198

Direction into the character's cover (rad, 0 faces +z): what it is pressed against.


down ​

down: boolean

Defined in: packages/protocol/src/messages.ts:184

A character lying knocked down (a tumbling box).


eid ​

eid: number

Defined in: packages/protocol/src/messages.ts:143

Server-side entity id.


exploded ​

exploded: boolean

Defined in: packages/protocol/src/messages.ts:220

A vehicle that has blown up: a charred wreck.


fuelled ​

fuelled: boolean

Defined in: packages/protocol/src/messages.ts:216

A vehicle filled up at a pump, its boost recharging twice as fast (the simulation's fuel.ts).


gen ​

gen: number

Defined in: packages/protocol/src/messages.ts:256

Its life under its id (eight bits, wrapping): the simulation turns it over whenever an id is freed, so an entity made under a freed id is told apart from the one before it.


ghost ​

ghost: boolean

Defined in: packages/protocol/src/messages.ts:244

A player's character just back from lying dead: a ghost for a few seconds, passing through cars and people, taking no harm.


gripFront ​

gripFront: number

Defined in: packages/protocol/src/messages.ts:174

Side grip of the front axle, 0..1 (0 for a character).


gripRear ​

gripRear: number

Defined in: packages/protocol/src/messages.ts:176

Side grip of the rear axle, 0..1 (0 for a character).


handbrake ​

handbrake: boolean

Defined in: packages/protocol/src/messages.ts:164

Handbrake held.


health ​

health: number

Defined in: packages/protocol/src/messages.ts:192

Hit points left: a character's, a vehicle's (a trailer carries its tractor's); 0 = dead or wrecked.


hostile ​

hostile: boolean

Defined in: packages/protocol/src/messages.ts:202

A character that is an enemy NPC (a chaser), drawn in its own colour; never a player or a pedestrian.


inside ​

inside: number

Defined in: packages/protocol/src/messages.ts:188

For a character: the entity id of the vehicle it sits in, or NOT_INSIDE; for a trailer: its tractor; for a loose piece (prop): its placement's index in the level; a door's or a camera's index in the level; how many an item is; a nail strip's length (cm).


invincible ​

invincible: boolean

Defined in: packages/protocol/src/messages.ts:204

A character that shrugs off every hit (the infinite-health switch).


jacking ​

jacking: boolean

Defined in: packages/protocol/src/messages.ts:206

A character in a carjack's beat: it pulled a driver out and is about to take the wheel.


kind ​

kind: "prop" | "door" | "item" | "vehicle" | "container" | "camera" | "trailer" | "terminal" | "character" | "projectile" | "nails"

Defined in: packages/protocol/src/messages.ts:145

What it is.


landing ​

landing: number

Defined in: packages/protocol/src/messages.ts:172

Seconds of dulled control left after a hard landing (0 for a character).


locked ​

locked: boolean

Defined in: packages/protocol/src/messages.ts:229

A locked vehicle.


owner ​

owner: number

Defined in: packages/protocol/src/messages.ts:158

Client id of the player controlling it: a character's player, a vehicle's driver (0 = nobody).


ownerId ​

ownerId: number

Defined in: packages/protocol/src/messages.ts:238

Which one: a player's client id, an NPC's entity id; a dog's walker's entity id, a dog walker's dog's; 0 otherwise.


ownerKind ​

ownerKind: number

Defined in: packages/protocol/src/messages.ts:236

Who owns a vehicle, by the simulation's OWNER_KINDS: 0 nobody, 1 a player, 2 an NPC, 3 a mission. For a dog and for a dog walker, their lead (the simulation's leadWire, read back by its decodeLead): what the dog does in the low four bits, whether it is on its lead (0x10) and whether ownerId names the other end of it (0x20).


paint ​

paint: number

Defined in: packages/protocol/src/messages.ts:240

A vehicle's paint: 0 its own colour, 1 and up a respray's.


parked ​

parked: boolean

Defined in: packages/protocol/src/messages.ts:212

A vehicle on its parking brake: nobody has driven it since it was spawned or left.


police ​

police: boolean

Defined in: packages/protocol/src/messages.ts:208

A character that is a police officer, drawn as police; never a player.


pose ​

pose: Pose

Defined in: packages/protocol/src/messages.ts:160

Authoritative pose (a seated character carries its vehicle's).


pursuit ​

pursuit: boolean

Defined in: packages/protocol/src/messages.ts:242

A vehicle with the pursuit tune: an interceptor's engine (the police's faster cars at three stars).


seat ​

seat: number

Defined in: packages/protocol/src/messages.ts:190

For a seated character: its seat (0 = driver); a door's opening (0 shut, 1 or 2 swung either way); 1 for a locked container; a terminal's verb (0 use, 1 hack).


siren ​

siren: boolean

Defined in: packages/protocol/src/messages.ts:210

A vehicle whose siren wails.


sitting ​

sitting: boolean

Defined in: packages/protocol/src/messages.ts:214

A character sitting on a seat of the level (the simulation's sitting.ts).


status ​

status: number

Defined in: packages/protocol/src/messages.ts:222

A character's status (the simulation's STATUSES): 0 awake, 1 stunned, 2 knocked out, 3 asleep, 4 down, 5 dead.


steer ​

steer: number

Defined in: packages/protocol/src/messages.ts:162

Smoothed steering in [-1, 1] (for the wheel sprites); 0 for characters.


tyres ​

tyres: number

Defined in: packages/protocol/src/messages.ts:178

Bitmask of flat tyres, bit i = wheel i (vehicles and trailers).


weapon ​

weapon: number

Defined in: packages/protocol/src/messages.ts:182

The weapon a character holds (its selected slot's); a projectile's weapon.


wheelContact ​

wheelContact: number

Defined in: packages/protocol/src/messages.ts:166

Bitmask of wheels touching the ground (bit i = wheel i); for a character, bit 0 = standing.