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

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 containing its assigned key and value.

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


Purpose

In the flowgraph system, a parent project can iterate over data by spawning child managers. Each child receives a foreach module pre-loaded with:

  • key - the iteration key (index or table key)
  • value - the iteration value
  • parentGraphId - the parent graph that spawned this child

Key Methods

MethodSignatureDescription
init()Calls clear().
clear()Resets parentGraphId, key, and value to nil.
afterTrigger()No-op placeholder.
executionStopped()No-op placeholder.
executionStarted()No-op; logs key/value when debug logging is enabled (commented out).

Properties

PropertyDefaultDescription
moduleOrder1000Very late priority (runs after all other modules).
parentGraphIdnilID of the parent graph that created this foreach child.
keynilCurrent iteration key.
valuenilCurrent iteration value.

Usage Context

-- Parent flowgraph iterates over a table:
-- For each entry, a child manager is spawned with:
local foreachModule = childMgr:getModule("foreach")
foreachModule.parentGraphId = parentGraph.id
foreachModule.key = iterKey
foreachModule.value = iterValue

-- Child nodes access iteration data:
local fe = self.mgr:getModule("foreach")
local myKey = fe.key
local myValue = fe.value

See Also

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

Flowgraph File Module

Provides persistent key-value file storage for flowgraph projects. Reads and writes JSON save files in the `settings/cloud/flowgraphSaveData/` directory. Used by nodes to persist state across sessions

Flowgraph Level Module

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

On this page

PurposeKey MethodsPropertiesUsage ContextSee Also