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
Flowgraph Action ModuleFlowgraph AI Recording ModuleFlowgraph Button ModuleFlowgraph Camera ModuleFlowgraph Drift ModuleFlowgraph File ModuleFlowgraph Foreach ModuleFlowgraph Level ModuleFlowgraph Mission ModuleMission Replay ModulePrefab ModuleThread ModuleTimer ModuleTraffic ModuleUI ModuleVehicle Module

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 Extensionsflowgraphmodules

Flowgraph AI Recording Module

Handles recording and replaying AI vehicle scripts during mission execution. Used for mission testing - records the player's driving as an AI path, then saves it alongside mission test data.

Handles recording and replaying AI vehicle scripts during mission execution. Used for mission testing - records the player's driving as an AI path, then saves it alongside mission test data.

No public module exports - created via _flowgraph_createModule(C).


Purpose

When enabled, this module records the player vehicle's movement as an AI script path. On mission completion, the recording is saved to the mission's tests/ folder as a .missionTestData.json file for automated replay testing.


Key Methods

MethodSignatureDescription
init()Initializes AI recording state.
startAiRecording()Sends ai.startRecording() to the player vehicle's Lua VM.
stopAiRecording(attempt, totalChange)Sends ai.stopRecording() to the vehicle, which submits the recording back via hook.
startAiReplay()Replays a stored AI path from activity.startingOptions.aiPath using ai.startFollowing().
stopAiReplay()Stops AI script replay via ai:scriptStop().
onVehicleSubmitRecordingForMission(vehId, aiPath)Hook callback: receives the recorded AI path from the vehicle, packages it with vehicle/mission data, and saves to JSON.
setenabled(newEnabled)Toggles recording capability on/off.
isRecordingScriptAi()Returns whether recording is enabled.
executionStopped()Stops any active recording.

Hooks

HookDescription
onVehicleSubmitRecordingForMissionReceives AI path data from vehicle Lua after recording stops.

Saved Test Data Format

-- Saved to: mission.missionFolder/tests/recording_YYYY-MM-DD HH_MM_SS.missionTestData.json
{
  aiPath = { path = { {t=0, ...}, {t=1.5, ...}, ... } },
  userSettings = { ... },
  vehicle = {
    model = "etk800",
    config = "police",
    isConfigFile = true,
    licensePlate = "BNG 001",
  },
  attemptData = { ... },
  attemptStars = { ... },
  aiDuration = 45.2,  -- seconds
}

Properties

PropertyDefaultDescription
moduleOrder1Runs after missionReplayModule.
hooks{"onVehicleSubmitRecordingForMission"}Subscribed hooks.

Vehicle Communication

-- Recording uses a round-trip through vehicle Lua:
-- GE → Vehicle: ai.startRecording() / ai.stopRecording()
-- Vehicle → GE: extensions.hook("onVehicleSubmitRecordingForMission", objectId, aiPath)
veh:queueLuaCommand('obj:queueGameEngineLua("extensions.hook(...)")')

Additional Exports

executionStarted()

getVehicleStates()

  • Returns: any

See Also

  • Flowgraph Action Module - Related reference
  • Flowgraph Button Module - Related reference
  • Flowgraph Camera Module - Related reference
  • FlowGraph Guide - Guide

Flowgraph Action Module

Manages input action filtering for flowgraph projects. Allows nodes to block or allow specific player input actions during flowgraph execution (e.g., disabling certain controls during a mission cutsce

Flowgraph Button Module

Manages custom UI buttons displayed during flowgraph execution. Nodes can create, configure, and respond to button clicks through this module. Button state is sent to the UI via `guihooks.trigger('Cus

On this page

PurposeKey MethodsHooksSaved Test Data FormatPropertiesVehicle CommunicationAdditional ExportsexecutionStarted()getVehicleStates()See Also