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

Career Player Driving Module

M.dependencies = {'career_career'}

Dependencies

M.dependencies = {'career_career'}

Manages the player's driving state in career freeroam: traffic spawning, parking detection, police pursuits, vehicle recovery, and garage teleportation. Acts as the bridge between career systems and the traffic/parking gameplay modules.


Internal State

FieldTypeDescription
M.ensureTrafficboolFlag to re-spawn traffic on next opportunity (set in onCareerModulesActivated, cleared in setupTraffic)
M.debugModevariesAssigned as not shipping_build
M.preStartvariesAssigned as true

Public API

FunctionSignatureDescription
M.getPlayerData() → tableReturns player driving state (parking, traffic, pursuit data)
M.retrieveFavoriteVehicle()Spawns/teleports the favorite vehicle to the player's location
M.playerPursuitActive() → boolWhether the player is in an active police pursuit
M.resetPlayerState()Resets player parking/traffic tracking and pursuit state
M.teleportToGarage(garageId, veh, resetVeh)Teleports vehicle (and trailer) to a garage, turns off ignition
M.showPosition(pos)Points camera/walking direction at a world position; plays cam path if obstructed

Lifecycle Hooks

HookPurpose
M.onPlayerCameraReadySpawns traffic during loading screen
M.onTrafficStartedInserts player into traffic system, sets police probability
M.onTrafficStoppedClears player traffic data; re-spawns if ensureTraffic flag set
M.onPursuitActionHandles pursuit start/evade/arrest (fines, recovery prompt)
M.onVehicleParkingStatusTracks parking valid/exit events
M.onVehicleSwitchedUpdates player data for new vehicle
M.onCareerModulesActivatedSets ensureTraffic flag, calls setup if already in level
M.onClientStartMissionTriggers traffic setup
M.onUpdatePre-start light trigger cycling; pursuit stuck-timer (force evade after 10s)

Dependencies

  • career_career - active/tutorial checks
  • career_modules_inventory - favorite vehicle, vehicle spawning
  • career_modules_payment - police arrest fines
  • career_modules_fuel - minimum refueling check after garage teleport
  • career_modules_insurance_insurance - repair state for favorite vehicle
  • gameplay_traffic, gameplay_police, gameplay_parking - traffic subsystems
  • core_trailerRespawn - trailer teleportation handling

Player Data Structure

playerData = {
  trafficActive = 8,       -- number of active traffic vehicles
  isParked      = false,   -- currently in a valid parking spot
  traffic       = { ... }, -- traffic system data for player vehicle
  parking       = { ... }, -- parking tracking data
}

Traffic Setup

Traffic amount is read from settings with auto-calculation fallback. Police are temporarily set to 0 by default. Career-specific adjustments:

  • enableRandomEvents = false
  • arrestRadius = 15, evadeTime = 30
  • parkingPrecision = 0.2 (relaxed detection)

Usage Example

-- Check if player is being chased
if career_modules_playerDriving.playerPursuitActive() then
  -- disable certain actions
end

-- Teleport to garage
career_modules_playerDriving.teleportToGarage(garageId, playerVeh, true)

See Also

  • quickTravel - Taxi-based teleportation
  • permissions - Recovery action permissions

Career Player Attributes Module

M.dependencies = {'career_career'}

Career Quick Travel Module

M.dependencies = {'career_career'}

On this page

DependenciesInternal StatePublic APILifecycle HooksDependenciesPlayer Data StructureTraffic SetupUsage ExampleSee Also