RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Align For CouplingApply Velocity to VehicleBoost VehicleSet Vehicle ColorsCustom Parts Config ProviderEnter VehicleFlip UprightFreeze VehicleGenerate License PlateGet Vehicle ActiveGet Electrics ValueGet GearboxmodeGet Powertrain DataGravity ForceDistance From GroundHas Coupler TagIs CoupledIs Player UsableKeep VehicleMove Vehicle ToOn Cannon FiredOn Vehicle DestroyedOn Vehicle ResetOn Vehicle SpawnedOn Vehicle SwitchedPlayer UsableRandom Config ProviderRecover In PlaceRemove VehicleTimeline ReplaySet Vehicle ActiveSet Gearbox ModeSet IgnitionSet License PlateSet LightbarSet LightsShift to Gear IndexSpawn VehicleVehicle StatesTeleport To Last RoadToggle Vehicle ControlsMove To ShowroomVehicle TouchProps TouchStatic Object TouchTrack VehicleTrailer Respawn ControlVehicle Config ProviderGet Vehicle DataGet Vehicle DataGet Vehicle BoundsVehicle PingGet Vehicle Wheel Center
AI ParametersAI ArriveAI ChaseAI Directly ToAI DisableAI FleeAI FollowAI Follow WaypointsGet AI ModeAI Go To The End LineAI RandomFollow DecalroadAI StopAI Traffic

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 Extensionsflowgraphnodesvehicleai

AI Parameters

- **Node Name:** `AI Parameters`

Overview

  • Node Name: AI Parameters
  • Category: repeat_p_duration
  • File: extensions/flowgraph/nodes/vehicle/ai/aiParams.lua

Sets various AI driving parameters for a vehicle, including risk/aggression, speed, lane behavior, collision avoidance, and nitrous activation. Parameters are sent via queueLuaCommand each frame.

Pin Schema

Input Pins

PinTypeDefaultDescription
vehIdnumber0Vehicle ID (uses player vehicle if not specified)
risknumber0.3Riskiness / aggression (0.1–2.0)
routeSpeednumber0Route speed in m/s
routeModestring"off"Speed mode: off, set, limit
drivabilityCOnumber0Min drivability cutoff (hidden)
inLaneboolfalseWhether to use lane driving
avoidCarsbooltrueWhether to avoid collisions (hidden)
forceRiskboolfalseForce risk value for flee/chase modes (hidden)
activateNitrousboolfalseActivate/deactivate nitrous oxide (hidden)

Internals

Key Methods

MethodDescription
postInit()Sets up slider for risk (0.1–2.0) and hard templates for routeMode
work()Sends AI parameter commands to the vehicle each frame

AI Commands Sent

PinVehicle Lua Command
riskai.setAggression(value)
routeSpeedai.setSpeed(value)
routeModeai.setSpeedMode(value)
drivabilityCOai.setCutOffDrivability(value)
inLaneai.driveInLane("on"/"off")
avoidCarsai.setAvoidCars("on"/"off")
forceRiskai.setAggressionMode("off"/"rubberBand")
activateNitrousControls NOS controller + JATO input

Nitrous Logic

When activateNitrous is true, the node:

  1. Sets electrics.values.jatoInput to 1 (if available).
  2. Checks the nitrousOxideInjection controller and toggles it on if not armed.
  3. When false, reverses both operations.

How It Works

  1. Resolves the vehicle by ID or falls back to the player vehicle.
  2. For each non-nil input pin, queues the corresponding Lua command on the vehicle.
  3. Since category is repeat_p_duration, commands are sent every frame (p_duration because of queueLuaCommand latency).
  4. Risk value is clamped between 0.1 and 2.0.

Usage Example

-- Set cautious AI with speed limit:
-- vehId = aiVehicleId
-- risk = 0.3
-- routeSpeed = 20  (20 m/s ≈ 72 km/h)
-- routeMode = "limit"
-- inLane = true

-- Aggressive chase setup:
-- risk = 1.5
-- forceRisk = true
-- avoidCars = false

Key Dependencies

  • ai.setAggression() / ai.setSpeed() / ai.setSpeedMode() - vehicle AI API
  • ai.driveInLane() / ai.setAvoidCars() - vehicle AI behavior
  • controller.getController("nitrousOxideInjection") - NOS controller

See Also

  • AI Arrive (Flowgraph Node) - Related reference
  • AI Chase (Flowgraph Node) - Related reference
  • AI Directly To (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Get Vehicle Wheel Center

- **Node Name:** `Get Vehicle Wheel Center`

AI Arrive

- **Node Name:** `AI Arrive`

On this page

OverviewPin SchemaInput PinsInternalsKey MethodsAI Commands SentNitrous LogicHow It WorksUsage ExampleKey DependenciesSee Also