Streams Module Reference
Module defined in `lua/vehicle/guistreams.lua`. Manages the subscription-based data streaming system that feeds real-time vehicle telemetry to UI apps. When a UI app registers interest in a data category (e.g., engine data, wheel thermals), this module evaluates the corresponding handler each frame and sends results via `guihooks`. Prevents wasted computation by only evaluating streams that have active subscribers.
Module defined in lua/vehicle/guistreams.lua. Manages the subscription-based data streaming system that feeds real-time vehicle telemetry to UI apps. When a UI app registers interest in a data category (e.g., engine data, wheel thermals), this module evaluates the corresponding handler each frame and sends results via guihooks. Prevents wasted computation by only evaluating streams that have active subscribers.
See Also
- Guihooks: For general UI events.
- Communication: For UI data flow overview.
Public API
| Function | Signature | Description |
|---|---|---|
drawGraph | (k, val) (**callable**) | Plotting interface for UI graph app. |
hasActiveStreams | () (**callable**) | True if UI is requesting data. |
reset | () (**hook**) | Clears stream registration. |
setRequiredStreams | (state) (**callable**) | Bulk updates the active stream registry from the UI. |
update | () (**hook**) | Evaluates all active stream handlers. |
willSend | (streamName) (**callable**) | Checks if a specific data key is being requested by an app. Returns boolean. |
Usage Example
-- Check if a UI app is listening before computing expensive data
if streams.willSend("wheelThermals") then
-- Only compute thermal data if an app actually wants it
guihooks.queueStream("wheelThermals", computeWheelThermals())
endSounds Module Reference
Module defined in `lua/vehicle/sounds.lua`. This module interfaces with the game's audio engine to handle impacts, scrapes, wind, tires, and the JBeam soundscape. It also provides a wrapper for manage
Thrusters Module Reference
Module defined in `lua/vehicle/thrusters.lua`. This module manages the application of continuous forces (thrusters) and temporary impulses to the vehicle structure. It supports both JBeam-defined thru