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

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.

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


Purpose

Flowgraph nodes that need to persist data (progress, scores, flags) use this module. Each logical "file" is a JSON document with a data table and lastModified timestamp. Changes are batched and written after each trigger cycle.


Key Methods

MethodSignatureDescription
init()Calls clear().
clear()Resets loaded file cache and change tracking.
forceReload(file)Removes a file from the cache so next access re-reads from disk.
getFile(file)Loads a file from settings/cloud/flowgraphSaveData/{file}.save.json if not cached. Returns the file table.
write(file, field, value)Sets file.data[field] = value and marks the file as changed. Updates lastModified.
read(file, field)Returns file.data[field] for the given file.
afterTrigger()Writes all changed files to disk as JSON.
executionStopped()Calls clear().
executionStarted()Calls clear().

File Format

-- Stored at: settings/cloud/flowgraphSaveData/{name}.save.json
{
  lastModified = 1703275200,  -- os.time()
  data = {
    highScore = 15000,
    completedLevels = { "level1", "level2" },
    playerName = "Driver",
  }
}

Usage from Nodes

-- Writing persistent data:
local fileModule = self.mgr:getModule("file")
fileModule:write("myMission", "bestTime", 42.5)
fileModule:write("myMission", "completed", true)

-- Reading persistent data:
local bestTime = fileModule:read("myMission", "bestTime")  -- 42.5

-- Force re-read from disk:
fileModule:forceReload("myMission")

Properties

PropertyDefaultDescription
moduleOrder0Standard priority.
files{}Cache of loaded file tables keyed by name.
changed{}Set of file names with pending writes.

Storage Path

All files are stored under settings/cloud/flowgraphSaveData/ with the .save.json extension. The cloud prefix suggests these may be synced across sessions.


See Also

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

Flowgraph Drift Module

Receives drift gameplay callbacks (spinout, crash, scoring events) and exposes them to flowgraph nodes via a TTL-based callback system. Bridges `gameplay_drift_general` events into the flowgraph.

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

On this page

PurposeKey MethodsFile FormatUsage from NodesPropertiesStorage PathSee Also