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
Career BranchesCareer System CoreCareer Save System
Career Computer MenuCareer Fuel SystemInspect VehicleVehicle InventoryLinear TutorialLoaner VehiclesCareer LogLogbookMarketplaceMission WrapperCareer Painting ModuleCareer Part Inventory ModuleCareer Part Shopping ModuleCareer Payment ModuleCareer Permissions ModuleCareer Playbook Writer ModuleCareer Player Abstract ModuleCareer Player Attributes ModuleCareer Player Driving ModuleCareer Quick Travel ModuleCareer Rentals ModuleCareer Reputation ModuleCareer Spawn Points ModuleCareer Speed Traps ModuleCareer Test Drive ModuleCareer Tether ModuleCareer Tuning ModuleCareer UI Utils ModuleCareer Unlock Flags ModuleCareer Value Calculator ModuleVehicle Class GroupingVehicle Deletion ServiceVehicle PerformanceVehicle Shopping

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 Extensionscareermodules

Vehicle Deletion Service

M.dependencies = {'career_career'}

Dependencies

M.dependencies = {'career_career'}

Deferred vehicle deletion system for career mode. Flags vehicles for removal when the camera is far enough away and looking away, preventing visible pop-out.


Public API

FunctionSignatureReturnsDescription
M.flagForDeletion(vehId, callback)nilMarks a vehicle for deferred deletion; callback fires on delete
M.clearFlags(vehId)nilRemoves deletion flag from a vehicle
M.deleteFlaggedVehicles()nilImmediately deletes all flagged vehicles

Hooks (Lifecycle)

HookPurpose
M.onExtensionLoadedChecks career is active
M.onAnyMissionChangedDeletes flagged vehicles when a mission starts
M.onClientStartMissionClears all flags on mission load
M.onVehicleDestroyedClears flags for destroyed vehicles

Dependencies

ModulePurpose
career_careerCareer active check

Deletion Conditions

A flagged vehicle is deleted when both conditions are met:

  1. Camera distance > 100m from the vehicle
  2. Camera forward direction dot product with camera-to-vehicle vector is < 0 (looking away)

The onUpdate hook is dynamically registered/unregistered based on whether any vehicles are flagged, avoiding per-frame cost when idle.


Usage Examples

-- Flag a vehicle for deletion with a callback
career_modules_vehicleDeletionService.flagForDeletion(vehId, function()
  log("I", "cleanup", "Vehicle deleted out of sight")
end)

-- Cancel scheduled deletion
career_modules_vehicleDeletionService.clearFlags(vehId)

-- Force-delete all flagged vehicles immediately
career_modules_vehicleDeletionService.deleteFlaggedVehicles()

Additional Exports

Values/Properties

ExportDescription
M.onUpdateValue: nil
M.onUpdateValue: onUpdate

Vehicle Class Grouping

M.dependencies = {"gameplay_vehiclePerformance"}

Vehicle Performance

Runs the vehicle performance certification test (drag strip + skidpad). Records acceleration, braking, and lateral G data. Manages cinematic camera sequences during testing.

On this page

DependenciesPublic APIHooks (Lifecycle)DependenciesDeletion ConditionsUsage ExamplesAdditional ExportsValues/Properties