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

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

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.


Public Functions

FunctionSignatureDescription
M.createGroup(amount, params) → tableCreates a randomized vehicle group from installed vehicles
M.spawnGroup(group, amount, options) → groupIdSpawns a vehicle group in formation
M.spawnProcessedGroup(spawnData, spawnOptions) → groupIdSpawns pre-processed vehicle data with transforms
M.fitGroup(group, amount) → tableResizes a group array to the target amount (loops or trims)
M.placeGroup(vehIds, options)Teleports existing vehicles into a new formation
M.teleportGroup(vehIds, options)Alias for placeGroup
M.setVehicleSpawnData(group, amount) → tableParses vehicle group entries into spawn-ready data
M.getInstalledVehicleData(params) → tableGets filtered vehicle/config data from installed models
M.vehIdsToGroup(vehIds) → tableConverts vehicle IDs to a group array
M.spawnedVehsToGroup(ignorePlayer) → tableConverts all spawned vehicles to a group array
M.deleteVehicles(amount, groupName)Deletes vehicles spawned by this system
M.setupVehicles(amount, shuffle, mode, gap) → groupIdDEPRECATED - use spawnGroup
M.onSpawnCCallback(id)Starts engines on spawned vehicles by default

Module Settings

FieldDefaultDescription
M.startEnginestrueSpawn vehicles with engines running
M.useFullDatafalseInclude population data in group entries

Spawn Modes

ModeDescription
roadAheadAhead on road, facing away from start (default)
roadBehindBehind on road, facing towards start
roadAheadAltAhead on road, facing towards start
roadBehindAltBehind on road, facing away from start
trafficSmart traffic lane placement
raceGridRace starting grid (staggered 2-wide)
raceGridAltRace grid, shifted diagonal
lineLeft / lineRightLine perpendicular to direction
lineBehind / lineAheadLine along direction
lineAboveVertical stack

Usage Example

-- Create a random group of 10 cars/trucks
local group = core_multiSpawn.createGroup(10, {
  filters = {Type = {car = 1, truck = 0.5}},
  country = "germany"
})

-- Spawn with road formation, 20m spacing
local groupId = core_multiSpawn.spawnGroup(group, 10, {
  name = "myGroup",
  mode = "roadAhead",
  gap = 20,
  shuffle = true,
  randomPaints = true
})

-- Teleport existing vehicles into race grid
local vehIds = {101, 102, 103, 104}
core_multiSpawn.placeGroup(vehIds, {mode = "raceGrid", gap = 12})

-- Delete all spawned vehicles
core_multiSpawn.deleteVehicles()

Filter Parameters

Filter KeyExampleDescription
Type{car = 1, truck = 0.4}Vehicle type weights
maxYear2005Maximum model year (0 = auto-current year)
country"germany"Boost domestic vehicles

Notes

  • Population-weighted selection uses power-law distribution (popPower parameter).
  • Selected vehicles have their population reduced to avoid repetition.
  • Spawning uses the job system for non-blocking operation (unless options.instant).
  • Fires onVehicleGroupSpawned(vehIds, groupId, name) on completion.
  • Queues additional groups if spawning is busy.

See Also

  • jobsystem - Background spawning via coroutines
  • globals - spawn.spawnVehicle, core_vehicles

Multiseat Camera

Automatic camera system for multiseat mode. Calculates a shared camera view that encompasses all player vehicles by averaging positions and adjusting distance/FOV dynamically.

Online

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

On this page

Public FunctionsModule SettingsSpawn ModesUsage ExampleFilter ParametersNotesSee Also