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 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.

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

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


Purpose

When a mission runs via flowgraph, this module handles:

  • Processing vehicle visibility (player vehicle, traffic) based on mission parameters
  • Preparing vehicles (e.g., setting headlights based on time of day)
  • Tracking the original player vehicle for stash/restore
  • Removing stashed vehicles if needed
  • Firing mission lifecycle hooks and stopping missions on execution end

Key Methods

MethodSignatureDescription
init()Calls clear().
clear()Resets the processed flag.
processVehicles(params)Applies vehicle visibility settings: keepPlayer shows/hides the original player vehicle, keepTraffic unfreezes/freezes traffic. Only runs once per execution.
prepareVehicle(id)Prepares a vehicle for mission play (e.g., turns on headlights if it's nighttime). Defaults to player vehicle 0.
getOriginalPlayerId()Returns the vehicle ID from activity._startingInfo.vehId.
removeStashedPlayerVehicle()Permanently deletes the stashed original player vehicle (won't be restored after mission).
missionHook(name, data)Fires a custom event on the mission activity object and logs it.
executionStopped()Stops the mission if it's still ongoing via gameplay_missions_missionManager.stop(), fires onMissionFinished hook, re-evaluates hotlapping controls.
onClear()No-op placeholder.
executionStarted()Re-evaluates hotlapping controls, calls clear().

Vehicle Processing Parameters

ParameterTypeEffect
keepPlayerbooltrue: activates original player vehicle. false: hides it via setActive(0).
keepTrafficbooltrue: unfreezes stored traffic state. false: keeps traffic frozen.

Vehicle Preparation

-- Automatically sets headlights based on time of day:
local tod = core_environment.getTimeOfDay()
if tod and tod.time >= 0.225 and tod.time <= 0.775 then
  obj:queueLuaCommand("electrics.setLightsState(2)")
end
-- Range 0.225-0.775 = daytime (no lights needed... but logic is inverted?)
-- Actually sets lights ON during daytime - likely a night-check range

Properties

PropertyDefaultDescription
moduleOrder-100Early priority (vehicle setup before other modules).
processedfalseGuard flag to prevent double-processing vehicles.

Mission Lifecycle

executionStarted()
    │
    ├── processVehicles({ keepPlayer = false, keepTraffic = false })
    │   └── Hides player vehicle, freezes traffic
    │
    ├── prepareVehicle() → headlights based on ToD
    │
    │   ... mission runs ...
    │
    └── executionStopped()
        ├── gameplay_missions_missionManager.stop(mission)
        ├── extensions.hook("onMissionFinished")
        └── guihooks.trigger('hotlappingReevaluateControlsEnabled')

Usage from Nodes

-- Process vehicles at mission start:
local missionModule = self.mgr:getModule("mission")
missionModule:processVehicles({ keepPlayer = true, keepTraffic = false })

-- Get original player vehicle:
local origId = missionModule:getOriginalPlayerId()

-- Fire custom mission event:
missionModule:missionHook("checkpointReached", { index = 3 })

See Also

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

Flowgraph Level Module

Manages level-loading coordination for flowgraph projects. Handles deferred function execution during level loads, prefab registration, and collision reload scheduling.

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

On this page

PurposeKey MethodsVehicle Processing ParametersVehicle PreparationPropertiesMission LifecycleUsage from NodesSee Also