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 Vehicles

Central vehicle management - model/config catalog, spawning, replacing, removing, license plates, coupler/trailer management, and vehicle collections (multi-vehicle configs).

Central vehicle management - model/config catalog, spawning, replacing, removing, license plates, coupler/trailer management, and vehicle collections (multi-vehicle configs).


Public API - Catalog

FunctionSignatureDescription
M.getModel(key)Returns {model, configs} for a vehicle model key
M.getModelList(array?)Returns all models with filters and display info
M.getConfigList(array?)Returns all configs with filters
M.getConfig(modelName, configKey)Returns a specific config table
M.getCurrentVehicleDetails()Returns details for the player's current vehicle
M.getVehicleDetails(id)Returns details for any vehicle by id
M.getVehicleList()Returns all vehicles with model data and filters
M.createFilters(list)Creates filter aggregates from a list of configs/models
M.clearCache()Clears all file and model caches
M.getFilesJson()Returns cached list of vehicle info JSON file paths
M.getFilesParsed()Returns cached table of parsed file data (JSON, PC, paint files)
M.getPaintFiles()Returns cached list of .paintLibrary.json file paths
M.getModelsData()Returns table of all discovered model data {info={}, configs={}} keyed by model name
M.openSelectorUI()Opens the vehicle selector UI (freeroam only)
M.openSelectorUI_legcay()Opens the legacy vehicle selector UI
M.requestList()Sends vehicle list to CEF UI via guihooks
M.requestListEnd()Finalizes the vehicle list request (stops profiler)
M.reloadVehicle(playerId)Reloads the vehicle for a player; clears Steam license plate state
M.loadCustomVehicle(modelName, data)Sets TorqueScript vars for custom vehicle loading
M.convertVehicleInfo(info, infoFilename)Converts legacy color format to paint format; returns modified info
M.getAttributesWhiteList()Returns the filter attributes whitelist array
M.getAttributesConvertToDict()Returns the attributes-to-dict conversion list
M.getAttributesConvertToRange()Returns the attributes-to-range conversion list

Public API - Spawning

FunctionSignatureDescription
M.spawnNewVehicle(modelName, opt)Spawns a new vehicle; supports format 4 multi-vehicle configs
M.replaceVehicle(modelName, opt, otherVeh?, replaceWholeCollection?)Replaces an existing vehicle or collection
M.removeCurrent()Deletes the player's current vehicle
M.cloneCurrent()Clones the player's vehicle with same paint
M.removeAll()Deletes all vehicles
M.removeAllExceptCurrent()Deletes all except the player's vehicle
M.removeAllWithProperty(property)Removes all vehicles matching a property
M.spawnDefault()Spawns/replaces with the default vehicle config
M.getDefaultVehicleParams()Returns {modelName, opts} for the default vehicle

Public API - License Plates

FunctionSignatureDescription
M.setPlateText(txt, vehId?, designPath?, formats?)Sets license plate text and generates textures
M.makeVehicleLicenseText(veh?, designPath?)Generates license text from pattern or Steam name
M.getVehicleLicenseText(veh)Returns current license text
M.regenerateVehicleLicenseText(veh)Generates new text without applying it
M.isLicensePlateValid(text)Returns false if text contains "

Public API - Couplers & Collections

FunctionSignatureDescription
M.generateAttachedVehiclesTree(vehId)Builds tree of coupler-attached vehicles
M.getCouplerOffset(vehId, couplerTag)Returns coupler node offsets from ref node
M.changeMeshVisibility(delta)Adjusts part mesh alpha by delta
M.setMeshVisibility(alpha)Sets part mesh alpha directly

Key Fields

FieldDescription
M.couplerTagsOptionsTag → coupling behavior mapping
M.defaultVehicleModel"etk800" (tech) or "pickup" (game)

Hooks

HookDescription
M.onPreVehicleSpawnedCaches coupler nodes and offsets
M.onVehicleSwitchedUpdates player↔vehicle maps
M.onVehicleDestroyedCleans up couplers, caches, and collections
M.onCouplerAttachedRecords attached coupler data
M.onCouplerDetachedRemoves detached coupler data
M.onFileChangedInvalidates cache on vehicle file changes
M.onFileChangedEndFinalizes file change cache invalidation
M.onSettingsChangedCalled on SettingsChanged event
M.onSerializeCalled on Serialize event
M.onDeserializedCalled on Deserialized event

Module State

VariableTypeDefault
M.dependenciestable{ 'core_vehiclePaints' }
M.vehiclePlayersMaptable{}
M.playerVehicleMaptable{}
M.resetVehCollectionEnabledbooleantrue
M.vehCollectionstableActive vehicle collections keyed by main vehicle id
M.vehIdToVehCollectiontableMaps any vehicle id to its collection
M.initVehCollectionstable{}
M.initVehIdToVehCollectiontable{}
M.attachedCouplerstableArray of {objId1, objId2, nodeId, obj2nodeId}
M.vehsCouplerCachetable{}
M.vehsCouplerTagstable{}
M.vehsCouplerOffsettable{}
M.finalRangestable{}
M.computeFileCacheModestring"batch"

Usage Example

-- Spawn a specific config
local veh = core_vehicles.spawnNewVehicle("pickup", {
  config = "vehicles/pickup/d15_4wd_A.pc"
})

-- Replace current vehicle
core_vehicles.replaceVehicle("etk800", {config = "854_190d_A"})

-- Get model info
local data = core_vehicles.getModel("pickup")
log("I", "", "Default config: " .. data.model.default_pc)

-- Set license plate
core_vehicles.setPlateText("BEAMNG", vehId)

Vehicle Paints

Resolves, caches, and distributes vehicle paint data including paint libraries, paint collections, multi-paint setups, and random paint selection with weighted probability distributions.

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.

On this page

Public API - CatalogPublic API - SpawningPublic API - License PlatesPublic API - Couplers & CollectionsKey FieldsHooksModule StateUsage Example