Advanced Coupler Control
Manages automated coupling and decoupling of trailer hitches and tow connections. Handles coupler state machines, latch detection, and electrics integration for advanced towing setups.
Manages automated coupling and decoupling of trailer hitches and tow connections. Handles coupler state machines, latch detection, and electrics integration for advanced towing setups.
Public API
| Function | Description |
|---|---|
new(jbeamData) | Initializes the coupler group controller. |
detachGroup() | Releases all couplers within the group. |
tryAttachGroupImpulse() | Attempts to re-attach couplers using a physical impulse if they are within range. |
module.initSounds(jbeamData) | Initializes sound resources. |
module.resetSounds(jbeamData) | Resets sound state. |
module.onCouplerFound(nodeId, obj2id, obj2nodeId) | dump(couplerGroup) |
module.onCouplerAttached(nodeId, obj2id, obj2nodeId, attachForce) | Callback for coupler attached event. |
module.onCouplerDetached(nodeId, obj2id, obj2nodeId, breakForce) | Callback for coupler detached event. |
module.onGameplayEvent(eventName, ...) | Callback for gameplay event event. |
module.toggleGroup() | Toggles group. |
module.toggleGroupConditional(conditions) | Toggles group conditional. |
module.getGroupState() | Returns the group state. |
Hooks
| Hook | Description |
|---|---|
module.init(jbeamData) | print(M.name) |
module.reset(jbeamData) | Resets the controller to its initial state. |
module.updateGFX(dt) | Per-frame update for visual state and UI synchronization. |
Usage Example
-- Toggle the coupler lock
controller.getController("advancedCouplerControl").toggleCouplerLock()See Also
- Couplings - Fifth Wheel — Fifth wheel coupling system
- Couplings - Kingpin — Kingpin coupling system
4WD / Transfer Case Controller
Manages selectable four-wheel-drive and transfer case systems. Controls switching between 2WD/4WD modes, high/low range selection, and differential locking. Used on vehicles with configurable drivetrain modes like trucks and off-road vehicles.
Airplane Control Surfaces
Controls aerodynamic flight surfaces (ailerons, elevators, rudder, flaps) for airplane-type vehicles. Maps pilot inputs to control surface deflections and manages trim settings.