RoadDriverState
Since 0.7
What the road-driver behaviour keeps in ctx.state between ticks (read it, do not set it).
Signature
export interface RoadDriverState {
/** Metres along the road. */
s?: number
/** Laps completed, from `road.progress` (0 on an open road). */
lap?: number
/** Place in the race on this road, 1 first, from `road.progress`. */
place?: number
/** Metres past the start line, laps included (`road.progress`'s `distance`). */
distance?: number
/** More than 10 m backwards along the road (`road.progress`'s `wrongWay`). */
wrongWay?: boolean
/** +1 driving along the road, -1 against it. */
way?: number
/** The speed it is driving for now, m/s. */
targetSpeed?: number
/** Reversing out of a wedge this tick. */
backingOut?: boolean
/** Back-outs in all. */
backOuts?: number
/** Three back-outs in a row have failed; cleared when it gets going again. */
stuck?: boolean
/** {@link stepWedge}'s memory. */
wedge?: WedgeState
/** At the end of an open road, stopped there. */
finished?: boolean
/** The last steer it drove with. */
steer?: number
/** It has said why it cannot drive. */
warned?: boolean
/** Held still: before `startOn`, or after `stopOn`. */
held?: boolean
/** Seconds left of turning the wheels to the aim before pulling away after a restart. */
pullAway?: number
}
Import: import type { RoadDriverState } from "@argus/gameplay"
Members
| Member | Signature | Description |
|---|---|---|
s | s?: number | Metres along the road. |
lap | lap?: number | Laps completed, from road.progress (0 on an open road). |
place | place?: number | Place in the race on this road, 1 first, from road.progress. |
distance | distance?: number | Metres past the start line, laps included (road.progress's distance). |
wrongWay | wrongWay?: boolean | More than 10 m backwards along the road (road.progress's wrongWay). |
way | way?: number | +1 driving along the road, -1 against it. |
targetSpeed | targetSpeed?: number | The speed it is driving for now, m/s. |
backingOut | backingOut?: boolean | Reversing out of a wedge this tick. |
backOuts | backOuts?: number | Back-outs in all. |
stuck | stuck?: boolean | Three back-outs in a row have failed; cleared when it gets going again. |
wedge | wedge?: WedgeState | {@link stepWedge}'s memory. |
finished | finished?: boolean | At the end of an open road, stopped there. |
steer | steer?: number | The last steer it drove with. |
warned | warned?: boolean | It has said why it cannot drive. |
held | held?: boolean | Held still: before startOn, or after stopOn. |
pullAway | pullAway?: number | Seconds left of turning the wheels to the aim before pulling away after a restart. |