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

Mission Replay Module

Flowgraph module that manages mission replay recording and playback. Handles automatic recording during mission attempts, replay file management (deletion by count or size), metadata generation, and c

Flowgraph module that manages mission replay recording and playback. Handles automatic recording during mission attempts, replay file management (deletion by count or size), metadata generation, and camera state restoration during playback.


Module Properties

PropertyValueDescription
moduleOrder0Early initialization order
hooksonReplayStateChanged, onReplayRecordingValueRequested, onMissionAutoReplayRecordingSettingChanged, onMissionAttemptAggregatedEngine hooks consumed

Class Methods

Lifecycle

MethodDescription
C:init()Sets replayRecording = false, currentReplayFile = nil
C:executionStarted()Caches replay directory from core_replay.getMissionReplaysPath()
C:executionStopped()Stops recording if active; stops AI replay if aiRecording module exists

Recording Control

MethodDescription
C:startNewRec()Stops existing recording, deletes older replays per settings, starts new recording if enabled
C:stopIfRec()Stops recording if currently in "recording" state
C:deleteOlderReplays()Dispatches to deleteByMaxSize() or deleteByCount() based on enableMissionReplayCapModes setting
C:deleteByCount()Removes oldest replays when count exceeds countReplayCapMode setting
C:deleteByMaxSize()Removes oldest replays until total size is under maxSizeReplayCapMode MB
C:deleteReplayFile(file)Deletes a single replay file via FS:removeFile

File Management

MethodDescription
C:getMissionReplayFiles()Returns replay .rpl files sorted by creation time (oldest first)
C:buildMetaInfo(attempt, mission, progressKey)Writes .rplMeta.json alongside replay with mission ID, name, timestamp, career context, and attempt info
C:saveMetaInfoWithoutAttempt()Calls buildMetaInfo() with no attempt data, then clears currentReplayFile

Playback

MethodDescription
C:missionPlaybackStarted()Saves current camera mode/path, switches to orbit camera, unpauses sim
C:missionPlaybackEnded()Restores original camera mode (including camera path if applicable)

Hook Handlers

MethodDescription
C:onMissionAttemptAggregated(attempt, mission, progressKey)Saves meta info with attempt data after aggregation
C:onReplayRecordingValueRequested()Triggers UI hook with current recording state
C:onMissionAutoReplayRecordingSettingChanged(newValue)Updates replayRecording flag from user setting
C:onReplayStateChanged(state)Detects playback start/stop transitions for mission replays

Usage Example

-- Module is auto-managed by the flowgraph manager
-- Recording starts automatically when mission begins (if enabled)
local replayMod = mgr.modules.missionReplay

-- Manual recording control
replayMod.replayRecording = true
replayMod:startNewRec()

-- After attempt completes, meta info is auto-saved via hook
-- onMissionAttemptAggregated writes .rplMeta.json with:
-- { missionId, missionName, time, humanTime, context = { isInCareer, saveSlot }, attempt = { progressKey, attemptNumber } }

-- Replay playback camera handling is automatic:
-- saves original camera → switches to orbit → restores on end

Internal Details

  • Replay files stored at path from core_replay.getMissionReplaysPath()
  • Meta files use .rplMeta.json extension appended to replay filename
  • Camera path restoration supported via mgr.modules.camera reference
  • Uses core_jobsystem coroutine with 0.1s sleep to unpause sim after playback start
  • invertList helper reverses a list in-place (defined but used internally)

See Also

  • Flowgraph Action Module - Related reference
  • Flowgraph AI Recording Module - Related reference
  • Flowgraph Button Module - Related reference
  • FlowGraph Guide - Guide

Flowgraph Mission Module

Manages mission-specific vehicle handling, traffic control, and mission lifecycle events for flowgraph projects. Coordinates between the flowgraph execution and the mission system.

Prefab Module

Flowgraph module that manages prefab lifecycle-spawning, tracking, collision/navgraph reloading, vehicle extraction, and cleanup. Ensures all spawned prefabs are properly deleted when the flowgraph st

On this page

Module PropertiesClass MethodsLifecycleRecording ControlFile ManagementPlaybackHook HandlersUsage ExampleInternal DetailsSee Also