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
Route Distance (Flowgraph Node)Closest Road (Flowgraph Node)Custom Lua (Flowgraph Node)Distance Between (Flowgraph Node)Waypoints Distance (Flowgraph Node)File Exists (Flowgraph Node)Get First Element of Table (Flowgraph Node)Get Level Data (Flowgraph Node)Get Map Objects IDs by DynField (Flowgraph Node)Get Table Value By Key (Flowgraph Node)GHOST (Flowgraph Node)Hide Loading Screen (Flowgraph Node)Color HSV (Flowgraph Node)Line Point From Xnorm (Flowgraph Node)Load Level (Flowgraph Node)Load Project (Flowgraph Node)On Menu (Flowgraph Node)Perlin Noise (Flowgraph Node)Pop Action Map (Flowgraph Node)Get Project InfoPush Action MapRandom ColorRandom NumberRandom QuaternionRandom VectorRoad PropertiesGet Navgraph RouteRoute PositionTemplate NodeTimeTimed SequenceTo NumberTo StringWorld Editor Open

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 Extensionsflowgraphnodesutil

Template Node

- **Node Name:** `Template Node`

Overview

  • Node Name: Template Node
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/util/template.lua

A reference template demonstrating all available functionality for creating new flowgraph nodes. Not intended for production use - serves as documentation for node developers.

Pin Schema

Input Pins

PinTypeDefaultDescription
flowflowtrueFlow pin
numbernumber42Number pin
hidNumnumber42Hidden number pin
fixNumnumber42Hardcoded number pin
boolbooltrueBoolean pin
stringstring"Text"String pin
vec3vec3{1,2,3}3D vector pin
quatquat{0,0,0,1}Quaternion pin
colorcolor{1,1,1,0.5}Color pin
tabletablenilTable pin
anyanynilAny-type pin
multinumber|boolnilMulti-type pin

Output Pins

PinTypeDescription
flowflowFlow pin
numbernumberNumber pin
boolboolBoolean pin
stringstringString pin
vec3vec33D vector pin
quatquatQuaternion pin
colorcolorColor pin
tabletable (generic)Table pin
anyanyAny-type pin
multinumber|boolMulti-type pin

Internals - Node Lifecycle

Category Reference

CategoryBehavior
repeat_instantRuns every frame, instant result
repeat_p_durationRuns every frame, takes time to prepare
once_instantRuns once until reset, instant result
once_p_durationRuns once, takes time to prepare
once_f_durationRuns once, has temporal component (timer)
dynamic_instantSwitches between once/repeat, instant
simpleNo flow pins needed
providerNo flow or input pins
logicControls flowgraph flow

Lifecycle Methods

MethodWhen Called
init(mgr)Node created for the first time
_executionStarted()Project begins execution
work()Each frame during execution
_executionStopped()Project stops execution
_onClear()Before serialization or starting
destroy()Node is deleted

UI Methods

MethodPurpose
drawCustomProperties()Custom imgui in property window; return string for undo point
drawMiddle(builder, style)Custom imgui within the node body
showProperties()Called when properties panel opens
hideProperties()Called when properties panel closes

Serialization

MethodPurpose
_onSerialize(res)Save custom fields into res (fields in self.data auto-save)
_onDeserialized(data)Restore custom fields from data

How It Works

This node is a comprehensive reference. Key takeaways for node developers:

  1. self.data fields are automatically serialized - no need to handle them manually.
  2. Custom fields (like self.myField) need explicit _onSerialize/_onDeserialized.
  3. Pin names flow and value are auto-hidden for cleaner display.
  4. drawCustomProperties() should return a string reason to create an undo/redo history point.
  5. C.dependencies lists required extensions for performance (avoids runtime lookups).

Usage Example

-- Creating a minimal new node:
local C = {}
C.name = 'My Node'
C.description = 'Does something useful.'
C.category = 'repeat_instant'

C.pinSchema = {
  {dir = 'in', type = 'number', name = 'value', default = 0, description = "Input value."},
  {dir = 'out', type = 'number', name = 'result', description = "Output result."},
}

C.tags = {'mynode'}

function C:work()
  self.pinOut.result.value = self.pinIn.value.value * 2
end

return _flowgraph_createNode(C)

Key Dependencies

  • ui_imgui - ImGui bindings for custom UI
  • _flowgraph_createNode() - node registration function

See Also

  • Route Distance (Flowgraph Node) - Related reference
  • Closest Road (Flowgraph Node) - Related reference
  • Custom Lua (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Route Position

- **Node Name:** `Route Position`

Time

- **Node Name:** `Time`

On this page

OverviewPin SchemaInput PinsOutput PinsInternals - Node LifecycleCategory ReferenceLifecycle MethodsUI MethodsSerializationHow It WorksUsage ExampleKey DependenciesSee Also