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

Vehicle Active Pooling

Manages pools of vehicles with active/inactive states for performance. Controls which vehicles are visible (active) based on configurable limits and distance culling.

Manages pools of vehicles with active/inactive states for performance. Controls which vehicles are visible (active) based on configurable limits and distance culling.


Public API - Manager

FunctionSignatureDescription
M.createPool(data?)Creates and registers a new VehPool; returns pool object
M.deletePool(id)Removes a pool by id
M.getPool(name)Finds a pool by its name string
M.getPoolById(id)Returns a pool by its numeric id
M.getPoolOfVeh(vehId)Returns the pool containing vehId + active status
M.getAllPools()Returns the pools table
M.deleteAllPools()Removes all pools

VehPool Object Methods

MethodDescription
pool:insertVeh(vehId, forceInsert?)Adds a vehicle to the pool
pool:removeVeh(vehId)Removes a vehicle from the pool
pool:setVeh(vehId, activate, forceInsert?)Activates or deactivates a vehicle
pool:setAllVehs(activate)Activates/deactivates all vehicles
pool:cycle(vehId1?, vehId2?)Swaps one active for one inactive
pool:crossCycle(otherPool, vehId1?, vehId2?)Cycle across two different pools
pool:setMaxActiveAmount(amount)Sets active vehicle limit; hides excess
pool:activateByDistanceTo(pos?, dist?)Distance-based activation/deactivation
pool:getVehs()Returns all vehicle ids (active + inactive)
pool:deletePool(keepVehicles?)Deletes pool; optionally deletes inactive vehicles
pool:getSceneActiveAmount(vehTypes?)Counts active vehicles in the scene

Hooks

HookDescription
M.onVehicleActiveChangedSyncs pool state when a vehicle is toggled
M.onVehicleDestroyedRemoves destroyed vehicles from all pools
M.onClientEndMissionClears all pools on mission end
M.onSerializeCalled on Serialize event
M.onDeserializedCalled on Deserialized event
M.logErrorsBoolean. Enables error logging (default false).

Module State

VariableTypeDefault
logErrorsbooleanfalse

Usage Example

local pool = core_vehicleActivePooling.createPool({
  name = "trafficPool",
  maxActiveAmount = 10,
  poolingMode = "default"
})

-- Add vehicles
for _, veh in ipairs(myVehicles) do
  pool:insertVeh(veh:getID())
end

-- Distance-based culling in onUpdate
pool:activateByDistanceTo(playerPos, 300)

Trailer Respawn

Manages trailer attachment tracking, respawn placement, and vehicle train queries.

Vehicle Bridge (GE ↔ VLua Communication)

Black-box communication layer between GE Lua and vehicle Lua (VLua). All gameplay-related VLua requests should go through this bridge via `gameplayInterface` on the vehicle side.

On this page

Public API - ManagerVehPool Object MethodsHooksModule StateUsage Example