IS CSC

From LFS Manual
Jump to navigationJump to search

Introduction

The Car State Changed packet is sent by LFS when a car's state changes. The only state change currently being tracked is the car starting or stopping.

IS_CSC packet properties
Type Name Description
byte Size 20
byte Type ISP_CSC
byte ReqI 0
byte PLID player's unique id
byte Sp0
byte CSCAction
byte Sp2
byte Sp3
unsigned Time ms since start (as in SMALL_RTP)
CarContOBJ C

Packet Details

Size

The size of the packet is always 20 bytes.

Type

The packet type from the ISP_ enumeration, always ISP_CSC.

ReqI

ReqI is always equal to zero.

PLID

The player's unique ID.

CSCAction

A value from the CSC_ enumeration:

  • CSC_STOP: The car stopped moving.
  • CSC_START: The car started moving.

Time

The timestamp of the state change.

C

A CarContOBJ containing details about the car.

Notes

Starting and stopping have some tolerance of around 1 or 2 km/h, therefore slowly crawling from a standstill will not be detected as "starting", and not staying on the brakes may be detected as "stopping" even if the car never actually completed stopped. If you need more precision, you should probably use IS_MCI packets instead, while allowing enough tolerance that just turning the steering wheel doesn't register as "moving".