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

Suspect Traffic Role

Reference for the `suspect` traffic role, which marks a vehicle as a wanted suspect that police will chase. Manages the transition from watched → wanted → fleeing → arrested states.

Reference for the suspect traffic role, which marks a vehicle as a wanted suspect that police will chase. Manages the transition from watched → wanted → fleeing → arrested states.


Role Properties

PropertyValueDescription
personalityModifiers.aggressionoffset +0.2More aggressive driving
pursuitMode2Default pursuit mode (aggressive)

Actions

ActionDescription
watchPoliceInitial wanted state - waiting for police to notice
fleePoliceActive flee mode: max aggression (0.8), no lane/speed limits, strong respawn resistance
arrestFreezes vehicle (controller freeze)
clearClears all pursuit flags, unfreezes vehicle

Key Methods

onRoleEnded()

If the player was the target, triggers police evasion event.

onTrafficTick(tickTime)

Main logic per 0.25s tick:

  • When in "wanted" state, checks pursuit.sightValue against threshold (0.25 for AI, 1.0 for player)
  • If sight threshold met and speed threshold met:
    • Finds available (non-busy, non-reset) police vehicles
    • Calls gameplay_police.setPursuitMode() to start the chase
    • Targets the nearest police vehicle

onUpdate(dt, dtSim)

Currently a no-op - all logic runs in the tick handler.


Internals

State Flow

watchPolice → (police notices) → fleePolice → (caught) → arrest → (cleared) → clear

Sight & Speed Thresholds

ConditionAI VehiclePlayer Vehicle
Sight value threshold0.251.0
Speed threshold (normal)0 m/s0 m/s
Speed threshold (drive check)1 m/s1 m/s

The driveCheck flag increases the speed threshold, requiring the suspect to actually be moving before police engage.

Flee Mode Details

When fleeing:

  • AI mode set to "flee"
  • Aggression set to 0.8
  • Aggression mode OFF (no automatic slowing)
  • Drive in lane OFF, speed mode OFF
  • Respawn values heavily modified (800 active radius, 40 inner radius)

Usage Example

-- Assign suspect role to a traffic vehicle
local veh = gameplay_traffic.getTrafficData()[vehId]
veh:setRole('suspect')
veh.role:setAction('watchPolice')

-- Manually trigger flee
veh.role:setAction('fleePolice')

-- Arrest the suspect
veh.role:setAction('arrest')

-- Clear suspect status
veh.role:setAction('clear')

See Also

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

Standard Traffic Role

Reference for the `standard` traffic role, the default role for civilian traffic vehicles. Implements reactive behavior to collisions and crashes - pulling over, fleeing, following, exchanging insuran

Crash Detection

Reference for `gameplay_util_crashDetection`, which tracks vehicle damage in real-time to detect crashes and individual impacts. Provides event hooks for crash start/end and impact start/end, with acc

On this page

Role PropertiesActionsKey MethodsonRoleEnded()onTrafficTick(tickTime)onUpdate(dt, dtSim)InternalsState FlowSight & Speed ThresholdsFlee Mode DetailsUsage ExampleSee Also