Recovery Module Reference
Module defined in `lua/vehicle/recovery.lua`. This module handles the vehicle's "Rewind" functionality, "Home" point management, and automatic repair logic. It maintains a historic log of vehicle posi
Module defined in lua/vehicle/recovery.lua. This module handles the vehicle's "Rewind" functionality, "Home" point management, and automatic repair logic. It maintains a historic log of vehicle positions and rotations for playback.
See Also
- Obj: For the underlying teleportation commands.
- InitSequence: For recovery module startup order.
State Fields
| Variable | Description |
|---|---|
recoveryPoints | A dequeue object containing a queue of historic vehicle states {pos, dirFront, dirUp}. |
homePoint | The saved position and orientation for the "Home" feature. |
Public API - Path Recording & Playback
| Function | Signature | Description |
|---|---|---|
recovery.startRecovering | (useAltMode) | Transitions the module into playback mode, rewinding the vehicle along its historic path. |
recovery.stopRecovering | () | Commits the current rewind position, teleporting the vehicle there and resetting physics. Returns the module to recording mode. |
recovery.recoverInPlace | () | Repairs the vehicle at its current location without rewinding. |
Public API - Home Points
| Function | Signature | Description |
|---|---|---|
recovery.saveHome | (point) | Sets the vehicle's permanent Home location. |
recovery.loadHome | (moveTraffic) | Teleports the vehicle to the saved Home point and fully repairs it. |
Public API - Lifecycle & Data
| Function | Signature | Description |
|---|---|---|
recovery.clear | () | Purges all historic recovery points and the saved home point. |
recovery.onDeserialized | (v) | Restores recovery points and settings after a Lua VM reload. |
recovery.init | (path) | Module bootstrapping. Pre-calculates relative node positions for the visual ghost structure during rewind. |
recovery.updateGFX | (dtSim) | Main loop. In recording mode, captures snapshots every 0.2s. In playback mode, handles the visual transition and camera logic. |
module.setFreeCamActiveFlag | (active) | Sets the free cam active flag. |
module.getFreeCamActiveFlag | () | Returns the free cam active flag. Returns isFreeCamActive. |
Protocols Module Reference
Module defined in `lua/vehicle/protocols.lua`. Manages external telemetry export over UDP for motion simulator platforms, external dashboards, and hardware gauges. Smooths and packages vehicle state data (position, velocity, acceleration, orientation) into standardized binary packets at configurable update rates. Supports OutGauge (dashboard telemetry) and MotionSim (motion platform) standards.
ScriptAI Module Reference
Module defined in `lua/vehicle/scriptai.lua`. Handles high-fidelity path recording and playback for cinematic sequences and scripted behavior.