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 Level Module

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

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

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


Purpose

During level loading, certain operations must be deferred until the load completes. This module queues functions and manages collision reloads that need to happen either during or after level loading.


Key Methods

MethodSignatureDescription
init()Initializes function queues, prefab list, and reload flags.
clear()Clears all queues and resets flags.
beginLoadingLevel()Placeholder for level load start (currently no-op).
finishedLevelLoading()If collision reload was requested during loading, executes be:reloadCollision(). Then runs all queued functions.
afterTrigger()If collision reload was requested after loading, executes be:reloadCollision().
delayOrInstantFunction(fun)If a level is currently loading (core_gamestate.loading()), queues the function. Otherwise executes immediately.
prefabLoaded(id)Registers a loaded prefab ID and schedules collision reload (during or after loading depending on current state).
executionStopped()Calls clear().

Collision Reload Strategy

prefabLoaded(id)
      │
      ├── core_gamestate.loading() == true
      │   └── reloadCollisionOnLevelLoading = true
      │       (be:reloadCollision() called in finishedLevelLoading)
      │
      └── core_gamestate.loading() == false
          └── reloadCollisionOnAfterTrigger = true
              (be:reloadCollision() called in afterTrigger)

Properties

PropertyDefaultDescription
moduleOrder100Mid-high priority.
funs{}Queue of deferred functions to run after level loading.
uniqueFuns{}De-duplicated function queue.
prefabs{}List of loaded prefab IDs.
reloadCollisionOnLevelLoadingfalseFlag to reload collision when level finishes loading.
reloadCollisionOnAfterTriggerfalseFlag to reload collision on next afterTrigger.

Usage from Nodes

-- Defer a function until level is ready:
local levelModule = self.mgr:getModule("level")
levelModule:delayOrInstantFunction(function()
  -- setup spawned objects, etc.
  scenetree.findObject("myPrefab"):setHidden(false)
end)

-- Register a loaded prefab (triggers collision reload):
levelModule:prefabLoaded(prefabId)

See Also

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

Flowgraph Foreach Module

Minimal module that stores key-value iteration state for flowgraph projects spawned as foreach children. When a parent flowgraph iterates over a collection, each child manager gets a foreach module co

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.

On this page

PurposeKey MethodsCollision Reload StrategyPropertiesUsage from NodesSee Also