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

Core Command Handler

Handles `beamng:` URL scheme commands for mod management, map loading, toolchain, debugger control, and other async tasks triggered via protocol URLs or startup arguments.

Handles beamng: URL scheme commands for mod management, map loading, toolchain, debugger control, and other async tasks triggered via protocol URLs or startup arguments.


Overview

The command handler processes beamng:v1/command/data protocol URLs. Commands arrive via OS-level URL scheme registration or startup arguments (-command "beamng:...") and are dispatched to the appropriate extension. Commands received before UI is ready are cached and replayed once onUiReady fires.


Public Functions

FunctionSignatureDescription
onSchemeCommand(scheme, isStartingArg)Parse and dispatch a scheme URL
onFirstUpdate()Process startup -command arguments
onUiReady()Flush cached commands from before UI init
onSerialize()Save reload flag
onDeserialized(d)Restore reload flag (skip startup cmd on GE reload)

URL Format

beamng:v1/command/data
       │   │       │
       │   │       └── Optional data payload (URL-encoded)
       │   └────────── Command name
       └────────────── Version string

Supported Commands

CommandVersionDescription
showModv1Open mod details in repository UI
subscriptionModv1Subscribe to a mod
downloadModv1Download and install a mod
updateZipModv1Replace a zip mod with a new version
openMapv1Load a map (JSON config) - uses core_loadMapCmd
loadSnapshotv1Load a game snapshot - uses core_snapshot
tech_utilsv1Call a function on tech_utils extension
core_input_actionsv1Trigger input actions (e.g., triggerDownUp/toggleCamera)
startToolchainServeranyLoad networking_editorToolchain extension
startDebugServeranyStart the Lua debug server
stopDebugServeranyStop the Lua debug server
attachDebuggeranyAttach the Lua debugger
detachDebuggeranyDetach the Lua debugger

Startup Argument Processing

-- Parse startup args for -command "beamng:..." 
local cmdArgs = Engine.getStartingArgs()
for i = 1, #cmdArgs do
  if cmdArgs[i] == '-command' then
    local arg = cmdArgs[i + 1]:stripcharsFrontBack('"\'')
    if arg:startswith('beamng:') then
      onSchemeCommand(arg:sub(8), true)  -- strip 'beamng:'
    end
  end
end

Command Caching

-- Commands received before UI ready are cached
if not uiReady then
  table.insert(cachedSchemes, {sc = scheme, startArg = isStartingArg})
  return
end
-- Flushed in onUiReady()

Mod Commands

-- Download and install a mod from repository
beamng:v1/downloadMod/MKA5UZHYS/6902/spanishpoliceroamerpack.zip
-- Handler:
extensions.core_repository.installMod(data, filename, 'mods/repo/')

Key Notes

  • URL data is unescaped (%20 → space) before parsing
  • ignoreStartupCmd flag prevents re-executing startup commands on GE Lua reload
  • openMap loads core_loadMapCmd with manual unload mode for queued navigation
  • core_input_actions supports arbitrary function calls with /-separated params
  • Unknown commands log an error but don't crash

Module State

VariableTypeDefault
onExtensionLoadedfunctionnop
  • M.onExtensionLoaded - Hook: extension loaded (nop).
  • M.onSchemeCommand(scheme, isStartingArg) - Handles URI scheme commands.
  • M.onFirstUpdate() - Hook: first update tick.
  • M.onUiReady() - Hook: UI is ready.
  • M.onSerialize() - Serializes command handler state.
  • M.onDeserialized(data) - Restores command handler state.

Core Checkpoints

Manages vehicle checkpoint saving and restoration for scenario races. Tracks waypoint progress, saves vehicle position/direction at each checkpoint, and handles automated AI vehicle resets when stuck.

Coupler Camera Modifier

Adjusts orbit camera distance and target when two vehicles are coupled (e.g. truck + trailer), centering the view between them. Automatically restores original camera settings on detach or when vehicl

On this page

OverviewPublic FunctionsURL FormatSupported CommandsStartup Argument ProcessingCommand CachingMod CommandsKey NotesModule State