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
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility

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 Extensionsui

Console (consoleNG)

In-game developer console with log filtering, command execution, and virtual scrolling.

In-game developer console with log filtering, command execution, and virtual scrolling.


Overview

ui_console provides a full-featured in-game console using ImGui. It displays game logs with level/origin filtering, supports GE Lua, TorqueScript, and CEF JS command execution, and includes virtual scrolling for performance.

Extension path: lua/ge/extensions/ui/console.lua
Dependencies: ui_imgui
Settings path: /settings/consoleNG.json


Exports (M)

FunctionSignatureDescription
show()Opens the console window.
hide()Closes the console window.
toggle()Toggles console visibility.
onUpdate(dtReal, dtSim, dtRaw)Main render loop - processes logs, draws ImGui.
onSerialize() → dataSaves console state for hot-reload.
onDeserialized(data)Restores console state after hot-reload.
onExtensionLoaded()Hook - initializes console state on load.
onFileChanged(path)Hook - responds to file changes.
onVehicleDestroyed(...)Hook - refreshes vehicle combo list.
onVehicleSwitched(...)Hook - refreshes vehicle combo list.
onVehicleSpawned(...)Hook - refreshes vehicle combo list.
onVehicleActiveChanged(...)Hook - refreshes vehicle combo list.

Data Fields

FieldDescription
M.dependencies{"ui_imgui"} - required for ImGui rendering.
M.onExtensionUnloadedCleanup callback assigned on the module table.
M.inputCallbackCallback function for console input processing.

Internals

Log Management

Logs are stored in a circular buffer (logs[] with logsHead/logsTail pointers), limited to ~1000 entries with 10% GC headroom:

if (logsTail - logsHead) > (logsLimit * 1.1) then
  while logsHead < (logsTail - logsLimit) do
    logs[logsHead] = nil
    logsHead = logsHead + 1
  end
end

Each log entry: {timestamp, level, origin, message}.

Filtering

Two filter types:

  • Level filter - Toggle D/I/W/E/A (Debug, Info, Warning, Error, All) via toolbar buttons
  • Origin filter - Lua pattern matching against the origin field

Filters rerun on change, maintaining a logFiltered[] index array.

Command Execution

Three execution contexts via dropdown:

ContextMethod
GE LuaexecuteLuaSandboxed(cmd) or Lua:queueLuaCommand(cmd)
TorqueScriptTorqueScript.eval(cmd)
CEF/UI JSbe:queueJS(cmd)
Vehicle Luavehicle:queueLuaCommand(cmd)

Command history (20 entries) is persisted to /consoleHistory.json.

Virtual Scrolling

Uses ImGuiListClipper for efficient rendering of large log lists - only visible rows are drawn. Force auto-scroll keeps the view at the bottom for live log monitoring.

Settings

Persisted to /settings/consoleNG.json:

  • Font size, background alpha, fullscreen mode
  • Level filters, vehicle controls toggle
  • History looping, sandbox mode, focus-on-show

Keyboard

  • Backtick (`) - Closes console (via input callback character filter)
  • Scroll Lock - Pauses log ingestion
  • Up/Down arrows - Navigate command history

How It Works

  1. toggle() or backtick key opens/closes the ImGui window
  2. Game frame logs are ingested via Engine.getFrameLog() each update
  3. Logs are filtered by level and origin pattern, indexed for virtual scroll
  4. User types commands in the input field, executed in selected context
  5. Settings and history persist across sessions via JSON files

Additional Exports

The following exports are available but not yet documented in detail:

  • M.hide
  • M.onConsoleLog
  • M.onDeserialized
  • M.onExtensionLoaded
  • M.onFileChanged
  • M.onSerialize
  • M.onUpdate
  • M.onVehicleActiveChanged
  • M.onVehicleDestroyed
  • M.onVehicleSpawned
  • M.onVehicleSwitched
  • M.show
  • M.toggle

Camera Distance App

Debug app that displays the distance between the camera and the player vehicle.

Credits Music

Plays credits background music via FMOD while the credits screen is active.

On this page

OverviewExports (M)Data FieldsInternalsLog ManagementFilteringCommand ExecutionVirtual ScrollingSettingsKeyboardHow It WorksAdditional Exports