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

Online

Online services client. Manages authentication sessions, API calls to BeamNG servers, file downloads with progress tracking, and server-pushed instructions (messages, mod updates).

Online services client. Manages authentication sessions, API calls to BeamNG servers, file downloads with progress tracking, and server-pushed instructions (messages, mod updates).


Public Functions

FunctionSignatureDescription
M.openSession()Initiates authentication with the online service
M.apiCall(uri, callback, postData, outfile, reqType, progressCb, postFile, authHeader)Makes a JSON API call to BeamNG servers
M.download(uri, callback, postData, outfile, reqType, progressCb)Downloads a file (non-JSON)
M.requestState()Sends online/Steam state to UI
M.getRequestsUI()Sends active request states to UI
M.clearRequest(id)Removes a completed request from tracking
M.onSettingsChanged()Enables/disables online features based on settings
M.onExtensionLoaded()Initializes based on current settings
M.onOnlineStateChanged(connected)Sends connection state + provider info to UI
M.onUIOnlineMessageReady()UI signals readiness to display messages
M.onUIOnlineMessageHide(uid)Persistently hides a message by UID
M.onInstructions(data)Processes server-pushed commands (messages, mod updates)
M.callbackSecureCommCpp(id, ...)C++ callback for completed requests (do not remove)
M.callbackSecureCommCppProgress(id, ...)C++ callback for download progress (do not remove)
M.requestSubscriptions()Requests online subscription data.
M.testWebsocket()Tests the websocket connection.

API Call Example

-- Simple API call with callback
core_online.apiCall("s1/v4/getMods", function(request)
  if request.responseData then
    local mods = request.responseData.data
    for _, mod in pairs(mods) do
      print(mod.title)
    end
  end
end, {query = "drift", page = 0})

-- Download a file
core_online.download("s1/v4/download/mods/ABC123", function(r)
  print("Downloaded to: " .. r.outfile)
end, nil, "/mods/repo/mymod.zip")

Request Object (Public)

FieldTypeDescription
idnumberUnique request identifier
statestring"working" or "finished"
responseCodenumberHTTP status code
responseDatatableParsed JSON response
responseBufferstringRaw response text
outfilestringOutput file path (for downloads)
dlnow / dltotalnumberDownload progress bytes
ulnow / ultotalnumberUpload progress bytes
dlspeed / ulspeednumberTransfer speeds
errorstringError message if failed

Server Instructions

The onInstructions handler processes commands from gameauth:

Command TypeAction
messageDisplays a message in the UI
modUpdateAvailableTriggers mod update check
repomsgSets repository message
repocmdSets repository command
automationmsgSets Automation integration message

Module State

VariableTypeDefault
sessionReqestedbooleantrue
requestSubscriptionsvariesrequestSubscriptions
testWebsocketvariestestWebsocket

Notes

  • Online features are gated by settings.getValue('onlineFeatures') == 'enable'.
  • Uses SecureComm.apiCall for authenticated HTTPS communication.
  • Hidden message IDs are persisted in settings as OnlineHiddenMessageIDs.
  • Full JSON encoder (lunajson) is used for POST data (not the fast/lossy one).
  • Session opens only once per game launch.

See Also

  • repository - Mod repository using online API
  • modmanager - Mod management and updates

Multi Spawn

Spawns groups of vehicles in configurable formations (road, grid, line). Handles vehicle selection from installed data with population-weighted randomization, paint assignment, and formation placement

Paths (Camera Paths)

Camera path system for cinematic playback. Creates, loads, saves, and plays spline-based camera paths with markers defining position, rotation, FOV, and timing.

On this page

Public FunctionsAPI Call ExampleRequest Object (Public)Server InstructionsModule StateNotesSee Also