RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Base Traffic RoleTraffic UtilitiesTraffic Vehicle
Empty Traffic RolePolice Traffic RoleStandard Traffic RoleSuspect Traffic Role

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 Extensionsgameplaytrafficroles

Empty Traffic Role

Reference for the `empty` traffic role, a minimal role that prevents extra actions or AI logic from being applied to a vehicle. Used when a vehicle needs to be in the traffic system but should not hav

Reference for the empty traffic role, a minimal role that prevents extra actions or AI logic from being applied to a vehicle. Used when a vehicle needs to be in the traffic system but should not have standard/police behavior (e.g., during non-traffic AI modes like flee or chase).


Role Definition

local C = {}
function C:init()
  self.actions = {}
  for k, v in pairs(self.baseActions) do
    self.actions[k] = v
  end
  self.baseActions = nil
end
return function(...) return require('/lua/ge/extensions/gameplay/traffic/baseRole')(C, ...) end

Behavior

  • No custom actions - Only inherits base actions (pullOver, disabled)
  • No personality modifiers - Uses default neutral personality
  • No custom tick/update logic - All lifecycle callbacks are inherited no-ops
  • Purpose: Acts as a "null" role - the vehicle exists in traffic but doesn't exhibit any role-specific behavior

How It's Used

The traffic system temporarily assigns the empty role when:

  1. A vehicle's AI mode is changed to something other than "traffic" (e.g., "flee", "chase")
  2. The previous role is stored in veh._tempRole
  3. When the AI mode returns to "traffic", the original role is restored
-- From gameplay_traffic.setTrafficVars():
if data.aiMode ~= 'traffic' and veh.roleName ~= 'empty' then
  veh._tempRole = veh.roleName
  veh:setRole('empty')
end

Usage Example

-- Manually assign empty role
local veh = gameplay_traffic.getTrafficData()[vehId]
veh:setRole('empty')

See Also

  • gameplay/traffic/roles/police - Police Traffic Role - Related reference
  • gameplay/traffic/roles/standard - Standard Civilian Traffic Role - Related reference
  • gameplay/traffic/roles/suspect - Suspect Traffic Role - Related reference
  • Gameplay Systems Guide - Guide

Traffic Vehicle

Reference for the traffic vehicle class (`gameplay/traffic/vehicle`), instantiated for each vehicle in the traffic system. Manages per-vehicle state including position tracking, damage detection, coll

Police Traffic Role

Reference for the `police` traffic role, which implements pursuit behavior including chasing suspects, managing sirens, avoiding head-on collisions, setting up roadblocks, and coordinating with the po

On this page

Role DefinitionBehaviorHow It's UsedUsage ExampleSee Also