RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

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

FunctionSignatureDescription
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)

FieldTypeDescription
cefVisibleboolWhether the CEF UI layer is visible
cursorVisibilityboolWhether the cursor should be visible
mouseLockedboolWhether the mouse is locked
cursorVisibleboolComputed: cursorVisibility and not mouseLocked

Hooks

HookDescription
M.onUpdatePer-frame: draws debug UI, raycasts triggers, highlights hovered
M.onCefVisibilityChangedUpdates CEF visibility state
M.onCursorVisibilityChangedUpdates cursor visibility
M.onMouseLockedUpdates mouse lock state
M.onSerialize / onDeserializedPersists debug UI and highlight state
M.onDeserialized(data)Restores trigger state from save.

Trigger System

  • Triggers are defined in JBeam triggers / triggers2 sections
  • triggerEventLinksDict[triggerId][actionStr] maps triggers to input actions
  • Supports both legacy targetEvent and v2 inputAction + namespace formats
  • 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.

On this page

Public APIState Table (M.state)HooksTrigger SystemUsage Example