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

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.

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


Purpose

Drift-related gameplay events fire asynchronously. This module captures them into a callback table with a 2-frame time-to-live, allowing flowgraph nodes to poll for recent events during their work cycle.


Key Methods

MethodSignatureDescription
init()Calls resetModule().
resetModule()Initializes all callback slots with ttl = 0.
onUpdate()Decrements TTL on all callbacks each frame.
getCallBacks()Returns the full callbacks table for node polling.
addCallback(name, data)Sets a callback entry with ttl = 2 and optional data payload.
onDriftSpinout()Hook: records a spinout event.
onDriftCrash()Hook: records a crash event.
onTightDriftScored(score)Hook: records a tight drift score event with score value.
onDonutDriftScored(score)Hook: records a donut drift score event with score value.
onDriftCompletedScored(data)Hook: records a completed drift event with addedScore, cachedScore, and combo.
onDonutZoneReactivated()Forwards to gameplay_drift_drift.onDonutZoneReactivated().

Hooks

HookDescription
onDriftSpinoutPlayer spun out during a drift.
onDriftCrashPlayer crashed during a drift.
onDonutDriftScoredDonut drift score awarded.
onTightDriftScoredTight drift score awarded.
onDriftCompletedScoredDrift combo completed and scored.

Callback Table Structure

self.callbacks = {
  tight   = { ttl = 2, data = { score = 1500 } },
  donut   = { ttl = 0 },  -- expired
  spinout = { ttl = 1 },  -- 1 frame remaining
  crash   = { ttl = 0 },
  tap     = { ttl = 0 },
  scored  = { ttl = 2, data = { addedScore = 500, cachedScore = 2000, combo = 3 } },
}
-- Nodes check: if callbacks.tight.ttl > 0 then ... end

Properties

PropertyDefaultDescription
moduleOrder0Standard priority.
hooks{'onDriftSpinout', 'onDriftCrash', 'onDonutDriftScored', 'onTightDriftScored', 'onDriftCompletedScored'}Subscribed gameplay hooks.
dependencies{'gameplay_drift_general'}Required extensions.

See Also

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

Flowgraph Camera Module

Manages camera path playback for flowgraph projects. Loads, stores, plays, and cancels camera paths. Used for cinematic sequences, mission intros, and scripted camera movements.

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

On this page

PurposeKey MethodsHooksCallback Table StructurePropertiesSee Also