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

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 Extensions

screenshot.lua - Screenshot System

Reference for `screenshot.lua`. Handles screenshot capture, metadata collection, format selection, and optional upload to BeamNG's media server.

Reference for screenshot.lua. Handles screenshot capture, metadata collection, format selection, and optional upload to BeamNG's media server.


Exports

KeySignatureDescription
doScreenshot(batchTag?, upload?, path?, ext?)Takes a screenshot with auto-naming or custom path
publish(batchTag?)Takes and uploads a screenshot (requires online features)
doSteamScreenshot()Triggers a Steam screenshot
openScreenshotsFolderInExplorer()Opens the screenshots folder in OS file browser
takeScreenShot()Standard screenshot (4x supersampling)
takeBigScreenShot()Large screenshot (9x supersampling)
takeHugeScreenShot()Maximum quality screenshot (36x, highest render settings)
screenshotTaken()C++ callback: GPU snapshot complete, restore render settings
screenshotSaved(res, filename)C++ callback: file written to disk
M.doScreenshot(batchTag, upload, path, ext)(No description available)
M.doSteamScreenshot()(No description available)
M.openScreenshotsFolderInExplorer()(No description available)
M.publish(batchTag)(No description available)
M.screenshotSaved(res, filename)res == 0 means all good
M.screenshotTaken()we revet some graphic settings in here only to return to a normal render state
M.takeBigScreenShot()(No description available)
M.takeHugeScreenShot()(No description available)
M.takeScreenShot()(No description available)

Internals

Metadata

getMetadataJson() collects and JSON-encodes:

  • Build info: version, arch, build type/number, shipping flag
  • Level name, game state
  • Steam ID hash and player name (if online)
  • Camera position and rotation
  • OS, CPU, GPU info (including Vulkan status)
  • Time of day
  • Custom data from onCollectScreenshotMetadata hook

Screenshot Path

Files are saved to screenshots/<date-folder>/screenshot_<datetime>[_N].<format> with auto-incrementing suffix to avoid overwrites. Format comes from settings.getValue("screenshotFormat").

Highest Quality Mode

takeHugeScreenShot temporarily overrides render settings:

  • $pref::TS::detailAdjust → 20 (default 1.5)
  • $pref::Terrain::lodScale → 0.001 (default 0.75)
  • Ground cover scale → 8 (default 1)
  • Sunsky texture size → 8192, shadow distance → 8000
  • Settings restored in screenshotTaken() callback

How It Works

  1. User triggers via keybind or Lua call.
  2. doScreenshot finds next available filename, collects metadata.
  3. Calls C++ createScreenshot(path, format, supersampling, tiles, overlap, downsample, upload, metadata).
  4. C++ captures the frame buffer, calls back screenshotTaken() (restore settings) then screenshotSaved().
-- Standard screenshot
screenshot.takeScreenShot()

-- Custom path
screenshot.doScreenshot(nil, false, '/tmp/myshot', 'png')

-- Upload to BeamNG servers
screenshot.publish()

Exported Variables

  • sc_GroundCoverScaleSaved - Exported variable - initialized as getGroundCoverScale()
  • sc_detailAdjustSaved - Exported variable - initialized as TorqueScriptLua.getVar("$pref::TS::detailAdjust")
  • sc_lodScaleSaved - Exported variable - initialized as TorqueScriptLua.getVar("$pref::Terrain::lodScale")
  • sc_sunskyShadowDistanceSaved - Exported variable - initialized as sunsky.shadowDistance
  • sc_sunskyTexSizeSaved - Exported variable - initialized as sunsky.texSize
  • screenshotHighest - Exported variable - initialized as highest

map.lua - Navigation Graph (AI Road Map)

Reference for `map.lua`. Builds and maintains the navigation graph (navgraph) used by AI traffic, GPS routing, and mission waypoints. Loads road data from DecalRoads and manual waypoints, then process

server/server - Level Loading & Game Server

Reference for `server/server.lua`. Manages level loading, mission lifecycle, physics initialization, and the loading screen. Despite the name, this is a local "server" - BeamNG runs a client-server ar

On this page

ExportsInternalsMetadataScreenshot PathHighest Quality ModeHow It WorksExported Variables