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
Bool (Flowgraph Node)Color (Flowgraph Node)Generic Set/Get Variable (Flowgraph Node)Get Variable (Flowgraph Node)Number (Flowgraph Node)Quat (Flowgraph Node)Set Variable (Flowgraph Node)String (Flowgraph Node)Transform (Flowgraph Node)Vec3 (Flowgraph Node)

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 Extensionsflowgraphnodestypes

Generic Set/Get Variable (Flowgraph Node)

- **Node Name:** `Generic Set/Get Variable`

Overview

  • Node Name: Generic Set/Get Variable
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/types/genericValue.lua

A dual-purpose node that either gets or sets a named flowgraph variable. Can operate on project-level (global) or graph-level variables.

Pin Schema

Input Pins

PinTypeDescription
flowflowInflow for this node
varNamestringName of the variable
suffixnumberOptional suffix appended to the variable name

Conditional Pins

ModePinDirectionTypeDescription
GettervaloutanyRetrieved variable value
SettervalinanyValue to assign to the variable

Output Pins

PinTypeDescription
flowflowPasses through input flow

Properties

PropertyTypeDefaultDescription
getterbooltrueIf true, reads the variable; if false, writes it
globalbooltrueIf true, uses project variables; if false, uses graph variables

Behavior

  • init() - Defaults to getter mode with global scope. Sets up get pins.
  • work() - Constructs the variable name from varName + optional suffix. In getter mode, calls self.target:get(varName). In setter mode, calls self.target:change(varName, value).
  • setupGetPins() - Removes any existing val pins, creates an out pin named val.
  • setupSetPins() - Removes any existing val pins, creates an in pin named val.

Serialization

  • _onSerialize(res) - Saves getter and global flags.
  • _onDeserialized(nodeData) - Restores flags and sets up appropriate pins.

How It Works

  1. Set varName to the variable you want to access.
  2. Toggle getter in properties to switch between read/write mode.
  3. Toggle global to choose between project-level and graph-level scope.
  4. Optionally use suffix for dynamic variable names (e.g. "score" + 1 → "score1").
-- Getter mode:
-- varName = "playerScore", suffix = nil
-- Reads from project variables: self.mgr.variables:get("playerScore")
-- Output: val = current value

-- Setter mode:
-- varName = "playerScore", val = 100
-- Writes to project variables: self.mgr.variables:change("playerScore", 100)

Key Dependencies

  • self.mgr.variables - Project-level variable storage
  • self.mgr.graph.variables - Graph-level variable storage

Additional Methods

C:drawCustomProperties()

Custom ImGui drawing for the node's properties panel in the editor.


See Also

  • Bool (Flowgraph Node) - Related reference
  • Color (Flowgraph Node) - Related reference
  • Get Variable (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Color (Flowgraph Node)

- **Node Name:** `Color`

Get Variable (Flowgraph Node)

- **Node Name:** `Get Variable`

On this page

OverviewPin SchemaInput PinsConditional PinsOutput PinsPropertiesBehaviorSerializationHow It WorksKey DependenciesAdditional MethodsC:drawCustomProperties()See Also