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
Vehicle Selector – Details InteractionVehicle Selector – GeneralVehicle Selector – Tile ClusteringVehicle Selector – Tile GroupingVehicle Selector – TilesVehicle Selector – Tile SortingVehicle Selector – Vehicle OperationsVehicle Selector – Vehicle Specifications

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 ExtensionsuivehicleSelector

Vehicle Selector – Vehicle Operations

Handles vehicle spawning, replacing, cloning, and management actions in the vehicle selector.

Handles vehicle spawning, replacing, cloning, and management actions in the vehicle selector.


Overview

ui_vehicleSelector_vehicleOperations provides all the action buttons for the vehicle selector: spawning new vehicles, replacing the current one, cloning, removing, resetting, random selection, and saving configs. Uses a fade/waiting screen for smooth transitions.

Extension path: lua/ge/extensions/ui/vehicleSelector/vehicleOperations.lua


Exports (M)

FunctionSignatureDescription
executeButton(buttonId, additionalData)Executes a registered button callback by ID.
executeDoubleClick(itemDetails)Finds and executes the double-click action button.
makeSpawningButtons(configDetails) → button[]Creates Spawn New + Replace Current buttons.
getManagementDetails() → tableReturns management buttons + current vehicle info.
getVehicleName(veh) → stringReturns formatted vehicle name (Brand Name Config).
getCurrentVehicleThumb(veh) → stringReturns preview image path.
addButton(...) → buttonRegisters a new button callback.
clearButtonFunctions()Clears all registered buttons.
onScreenFadeState(state)Executes deferred callback after fade completes.
setManagementButtonsEnabled(enabled)Toggles management buttons.
setDetailsButtonForFreeroam(enabled)Sets freeroam mode.
setCustomDetailsButtons(buttons)Sets custom button definitions.
getFreeButtonId(...)Returns the next available button ID from the button module.

Data Fields

FieldDescription
M.managementButtonsEnabledtrue - whether management buttons are shown.

Internals

Spawn/Replace Flow

  1. User clicks Spawn or Replace button.
  2. UI state changes to "play", then guihooks.trigger("app:waiting", true).
  3. A callbackAfterFade is set with the actual spawn/replace logic.
  4. When onScreenFadeState(1) or onUiWaitingState fires, the callback runs.
  5. Calls core_vehicles.spawnNewVehicle or core_vehicles.replaceVehicle.
  6. Fires appropriate extension hooks and disables waiting state.

Management Buttons

getManagementDetails creates these buttons (when enabled):

  • Save as default.pc (dev only) - core_vehicle_partmgmt.savedefault()
  • Load default.pc (dev only) - core_vehicles.spawnDefault()
  • Save current config - navigates to save UI
  • Clone Current - core_vehicles.cloneCurrent()
  • Select Random - picks random config passing current filters
  • Reset All - resetGameplay(-1)
  • Remove All - core_vehicles.removeAll()
  • Remove Current - core_vehicles.removeCurrent()
  • Remove Others - core_vehicles.removeAllExceptCurrent()

Paint Handling

When additionalData is provided (paint names), the spawn/replace functions look up paint objects from the model's paint table and pass them as spawn options.


How It Works

  1. makeSpawningButtons creates "Spawn New" and "Replace Current" (primary, double-click) buttons.
  2. Each button is registered via buttonInstance.addButton(callback, meta).
  3. On click, executeButton(id, additionalData) runs the callback.
  4. If filterResetOnSpawn is enabled, filters are cleared after spawning.
  5. Recent vehicle tracking is called on spawn/replace.

Lua Examples

-- Execute a button by ID
extensions.ui_vehicleSelector_vehicleOperations.executeButton(1, {
  paint = "Red", paint2 = "Black"
})

-- Get management details
local mgmt = extensions.ui_vehicleSelector_vehicleOperations.getManagementDetails()
print(mgmt.details.currentVehicleName)

Hooks

HookWhen
onVehicleSelectorSpawnNew (ext)New vehicle spawned
onVehicleSelectorReplaceCurrent (ext)Vehicle replaced
onVehicleSelectorCloneCurrent (ext)Vehicle cloned
onVehicleSelectorRemoveAll (ext)All vehicles removed
onVehicleSelectorRemoveCurrent (ext)Current vehicle removed
onVehicleSelectorRemoveOthers (ext)Other vehicles removed
onVehicleSelectorResetAll (ext)All vehicles reset
onVehicleSelectorSelectRandom (ext)Random vehicle selected
onVehicleSelectorSetAsDefault (ext)Saved as default.pc
onVehicleSelectorLoadDefault (ext)Loaded default.pc

Additional Exports

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

  • M.addButton
  • M.clearButtonFunctions
  • M.customDetailsButtons
  • M.detailsButtonForFreeroam
  • M.executeButton
  • M.executeDoubleClick
  • M.getCurrentVehicleThumb
  • M.getFreeButtonId
  • M.getManagementDetails
  • M.getVehicleName
  • M.makeSpawningButtons
  • M.onScreenFadeState
  • M.onUiWaitingState
  • M.setCustomDetailsButtons
  • M.setDetailsButtonForFreeroam
  • M.setManagementButtonsEnabled

Vehicle Selector – Tile Sorting

Sorting functions for vehicle selector tiles by various criteria.

Vehicle Selector – Vehicle Specifications

Builds the detailed specifications panel for a selected vehicle config.

On this page

OverviewExports (M)Data FieldsInternalsSpawn/Replace FlowManagement ButtonsPaint HandlingHow It WorksLua ExamplesHooksAdditional Exports