API ReferenceGE Extensionscore
Vehicle Triggers
Handles interactive vehicle triggers (buttons, levers, switches) that appear on vehicles. Manages cursor-based raycasting, input action binding, and a debug ImGui window.
Handles interactive vehicle triggers (buttons, levers, switches) that appear on vehicles. Manages cursor-based raycasting, input action binding, and a debug ImGui window.
Public API
| Function | Signature | Description |
|---|---|---|
M.onActionEvent | (actionNumber, inputValue) | Primary handler for trigger input (action0, action1, action2) |
M.triggerEvent | (actionStr, actionValue, triggerId, vehicleId, vdata) | Fires a trigger event by action string |
M.triggerEventWithoutVdata | (actionNum, actionValue, triggerId, vehicleId) | Fires a trigger event (used by VR controllers) |
M.enableDebugUI | () | Enables the ImGui debug window |
State Table (M.state)
| Field | Type | Description |
|---|---|---|
cefVisible | bool | Whether the CEF UI layer is visible |
cursorVisibility | bool | Whether the cursor should be visible |
mouseLocked | bool | Whether the mouse is locked |
cursorVisible | bool | Computed: cursorVisibility and not mouseLocked |
Hooks
| Hook | Description |
|---|---|
M.onUpdate | Per-frame: draws debug UI, raycasts triggers, highlights hovered |
M.onCefVisibilityChanged | Updates CEF visibility state |
M.onCursorVisibilityChanged | Updates cursor visibility |
M.onMouseLocked | Updates mouse lock state |
M.onSerialize / onDeserialized | Persists debug UI and highlight state |
M.onDeserialized(data) | Restores trigger state from save. |
Trigger System
- Triggers are defined in JBeam
triggers/triggers2sections triggerEventLinksDict[triggerId][actionStr]maps triggers to input actions- Supports both legacy
targetEventand v2inputAction+namespaceformats - Namespaces:
vehicle(Lua command),common(C++ ActionMap or Lua)
Usage Example
-- Enable the debug window
extensions.core_vehicleTriggers.enableDebugUI()
-- Programmatically fire a trigger
local vData = core_vehicle_manager.getVehicleData(vehId)
extensions.core_vehicleTriggers.triggerEvent("action0", 1, triggerId, vehId, vData.vdata)Core Vehicles
Central vehicle management - model/config catalog, spawning, replacing, removing, license plates, coupler/trailer management, and vehicle collections (multi-vehicle configs).
Version Update
Detects game version changes on startup and performs folder cleanup when a major version update is detected.