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

Get Variable (Flowgraph Node)

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

Overview

  • Node Name: Get Variable
  • Category: provider
  • File: extensions/flowgraph/nodes/types/getVariable.lua
  • Icon: cloud_download
  • Hidden: Yes (created via variable system, not node palette)

Reads a flowgraph variable (graph-local or project-global) and outputs its current value through a dynamically typed output pin.

Pin Schema

Output Pins

PinTypeDescription
(dynamic)(matches variable type)The current value of the selected variable

The output pin is created dynamically based on the selected variable's name and type.

Internals

FieldPurpose
self.varNameName of the selected variable
self.globaltrue = reads from project-level variables; false = graph-local
self.targetReference to the variable store (graph.variables or graph.mgr.variables)
self.localColorNode tint when using local variables - ImVec4(1, 0.8, 0.6, 0.75)
self.globalColorNode tint when using global variables - ImVec4(1, 0.6, 0, 0.8, 0.75)

How It Works

  1. init() - Sets varName = nil, defaults to local graph variables.
  2. setGlobal(global) - Switches the variable source between graph-local and project-global. Removes the current output pin and resets varName.
  3. setVar(name) - Looks up the variable by name, removes the old output pin, creates a new pin matching the variable's type, and reconnects compatible links.
  4. work() - Reads the variable value from the target store and writes it to the output pin.
  5. renameVariable(source, name, newName) - Called by the variable system when a variable is renamed; updates the pin name and internal references.
  6. typeUpdated(source, name, newType) - Called when a variable's type changes; recreates the output pin with the new type and reconnects compatible links.
  7. drawMiddle() - Shows the current variable value inline or ??? if the variable is missing.

Serialization

  • Saves varName and global flag.
  • On deserialization, calls setGlobal() then setVar() to rebuild the pin.

Example Usage

-- In the flowgraph editor, this node is created automatically when
-- you drag a variable from the variable panel as a "getter".
-- It reads the variable each frame and outputs its value.
--
-- Equivalent runtime behavior:
local value = self.graph.variables:get("myVar")

Additional Methods

C:_onDeserialized(nodeData)

Called after the node is deserialized (loaded from file). Restores runtime state from saved data.

Parameters:

  • nodeData

C:_onSerialize(res)

Called when the node is serialized (saved to file). Returns data to persist.

Parameters:

  • res

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
  • Generic Set/Get Variable (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Generic Set/Get Variable (Flowgraph Node)

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

Number (Flowgraph Node)

- **Node Name:** `Number`

On this page

OverviewPin SchemaOutput PinsInternalsHow It WorksSerializationExample UsageAdditional MethodsC:_onDeserialized(nodeData)C:_onSerialize(res)C:drawCustomProperties()See Also