API Referenceveextensions
Couplings
Manages trailer hitches, fifth-wheel connections, and auto-coupling logic. Handles the attach/detach lifecycle for towed vehicles.
Manages trailer hitches, fifth-wheel connections, and auto-coupling logic. Handles the attach/detach lifecycle for towed vehicles, including automatic latching when vehicles come into proximity.
Public API
| Function | Signature | Description |
|---|---|---|
isAutoCouplingActive | () → boolean | Returns whether automatic coupling is currently enabled. Called by beamstate to determine toggle behavior. |
isCouplerAttached | () → boolean | Returns whether any coupler on this vehicle is currently attached to another vehicle. |
Hooks
| Hook | Description |
|---|---|
onBeamstateActivateAutoCoupling | Called when auto-coupling is activated via the toggle UI. Enables proximity-based automatic latching. |
onBeamstateDisableAutoLatching | Called when auto-coupling is disabled via the toggle UI. Stops automatic latching but keeps existing connections. |
onBeamstateDetachCouplers | Called when couplers are detached via the toggle UI. Releases all active coupling connections. |
Usage Example
-- Check if a trailer is attached
if extensions.couplings.isCouplerAttached() then
log("I", "trailer", "Trailer is connected")
end
-- Query auto-coupling state
local autoCoupling = extensions.couplings.isAutoCouplingActive()See Also
- Gameplay Interface — External system bridge that can trigger coupling actions
Chassis Data
Reports vehicle dimensions including track width, wheelbase, overall length, width, and height. Used by other systems for physics calculations and UI display.
Cruise Control
Advanced speed maintenance system with PID control and target speed ramping. Maintains a set vehicle speed by modulating throttle and brake inputs.