IS AII
From LFS Manual
Jump to navigationJump to searchIntroduction
The AI Info packet is used to get information about an AI car.
| Type | Name | Description |
|---|---|---|
| byte | Size | 96 |
| byte | Type | ISP_AII |
| byte | ReqI | ReqI from the SMALL_AII request packet |
| byte | PLID | |
| OSMain | OSData | |
| byte | Flags | AIFLAGS_x below |
| byte | Gear | Reverse:0, Neutral:1, First:2... |
| byte | Sp2 | |
| byte | Sp3 | |
| float | RPM | RPM |
| float | SpF0 | |
| float | SpF1 | |
| unsigned | ShowLights | Dash lights currently switched on (see DL_x in OutGauge section below) |
| unsigned | SPU1 | |
| unsigned | SPU2 | |
| unsigned | SPU3 |
Packet Details
Size
The size of the packet is always 96 bytes.
Type
The packet type from the ISP_ enumeration, always ISP_AII.
ReqI
The value is the same as the one set in the packet request (IS_AIC with CS_SEND_AI_INFO or SMALL_AII).
PLID
The unique ID of the AI driver.
OSData
Identical to the data found in OutSimMain, this contains the car's position, velocity, acceleration, orientation, and angular velocity, all as vectors of floats (or ints for position).
Flags
A combination of the following AI flags:
#define AIFLAGS_IGNITION 1 // detect if engine running // #define AIFLAGS_CHUP 4 // upshift lever currently held #define AIFLAGS_CHDN 8 // downshift lever currently held
Gear
The current gear, where 0 is reverse, 1 is neutral, 2 and up are the forward gears.
RPM
The current RPM of the engine.
ShowLights
The dash lights currently switched on (see DL_ enumeration).