Control Modes
Manages multiple input mapping profiles that change how physical controls are interpreted. Each mode can remap, scale, and smooth input axes differently — useful for vehicles with multiple operating modes (e.g., crane vs. drive mode on utility vehicles).
Manages multiple input mapping profiles that change how physical controls are interpreted. Each mode can remap, scale, and smooth input axes differently — useful for vehicles with multiple operating modes (e.g., crane vs. drive mode on utility vehicles).
State Fields
| Field | Type | Description |
|---|---|---|
controlModeName | string | The human-readable name of the currently active control mode. |
controlModeIndex | number | The index of the active control mode in the defined modes list. |
Public API
| Function | Description |
|---|---|
setControlModeIndex(index) | Directly switches to a specific control mode. |
toggleControlMode(value) | Cycles through available control modes. |
setInputValue(name, value) | Overrides or sets a raw input value for use in mode mapping. |
Hooks
| Hook | Description |
|---|---|
init(jbeamData) | Initializes available modes and registers them in the radial Quick Access menu. |
updateGFX(dt) | Maps current physical inputs to target electrics signals based on the active mode's smoothing and speed settings. |
Usage Example
-- Cycle to the next control mode
controller.getController("controlModes").toggleControlMode(1)
-- Jump to a specific mode by index
controller.getController("controlModes").setControlModeIndex(2)See Also
- Drive Modes — Vehicle-wide driving profiles
- Vehicle Controller — Main control logic
Controller Template
A boilerplate template for creating new custom vehicle controllers. Copy this file as a starting point when developing a new controller module. It demonstrates the standard lifecycle hooks, state management, and API patterns.
Drag Timer
Precision timing controller for drag racing. Measures elapsed time and trap speed over standard drag racing distances (60ft, 330ft, 660ft, 1000ft, 1/4 mile, 1/2 mile). Integrates with the UI to display live timing data.