API Referenceveextensions
Cruise Control
Advanced speed maintenance system with PID control and target speed ramping. Maintains a set vehicle speed by modulating throttle and brake inputs.
Advanced speed maintenance system with PID control and target speed ramping. Maintains a set vehicle speed by modulating throttle and brake inputs automatically. Supports configurable minimum speed thresholds.
Public API
| Function | Signature | Description |
|---|---|---|
| (state only) | — | Cruise control is driven by input actions and hooks. Speed target is set via the vehicle input system. |
State Fields
M.hasReachedTargetSpeed -- boolean: true once the vehicle reaches the set speed
M.minimumSpeed -- minimum speed threshold below which cruise control disengagesHooks
| Hook | Description |
|---|---|
onReset | Disables cruise control and resets the target speed and PID state. |
Usage Example
-- Check if cruise control has reached target
if extensions.cruiseControl.hasReachedTargetSpeed then
log("I", "cruise", "Target speed reached")
endSee Also
- ACC — Adaptive Cruise Control (tech extension with radar)
- Gameplay Interface — Can trigger cruise control via external commands