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

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 Extensionsflowgraph

Flowgraph Link

Represents a connection between two pins in a flowgraph graph. Handles link initialization, drawing (including flow animation markers), tooltips, serialization, and quick-access conversion.

Represents a connection between two pins in a flowgraph graph. Handles link initialization, drawing (including flow animation markers), tooltips, serialization, and quick-access conversion.

No public module exports - instantiated via constructor function returned by require.


Purpose

Links connect a source output pin to a target input pin. They:

  • Wire pin values so targetNode.pinIn[name] reads from sourcePin
  • Track flow state for animated flow markers in the editor
  • Support hiding (shortcut display) and disabling
  • Handle state-graph directional routing (N/E/S/W transition pins)

Class (C) - Key Methods

MethodSignatureDescription
init(graph, sourcePin, targetPin)Allocates two IDs (main + hidden highlight), wires the target pin to read from source pin, registers in graph's links table, notifies both pins and nodes of the new link, sets color based on pin type.
draw()Renders the link line with type-colored styling. For flow/state pins, shows animated flow markers when active. For state links, routes through directional transition pins. Draws tooltip on hover.
drawLinkTooltip()Shows source pin type icon and current value on hover.
drawLabel(sPin, tPin)Draws a text label at the midpoint between two state transition pins.
getDirPins()Determines compass directions (N/E/S/W) between source and target nodes based on relative position.
doFlow()Queues a flow animation for next draw.
showContextMenu(menuPos)Context menu with Toggle Hide, Delete, and debug ID display.
convertToQuickAccess()Converts the link into quick-access pins (hidden link with named aliases) and deletes the visual link.
__onSerialize()Returns {sourceNodeId, sourcePinName, targetNodeId, targetPinName, hidden}.
__onDeserialized(data)Restores hidden state from serialized data.

Link Properties

PropertyTypeDescription
idnumberPrimary link ID for drawing and selection.
hiddenIdnumberSecondary ID for highlight overlay rendering.
sourcePinpinOutput pin this link reads from.
targetPinpinInput pin this link writes to.
sourceNodenodeNode owning the source pin.
targetNodenodeNode owning the target pin.
colorImVec4Link color derived from pin type (impulse/chainFlow override).
hiddenboolIf true, drawn as a shortcut (abbreviated) link.
disabledboolIf true, link is inactive.
labelstringText label for state transition links.

Flow Animation

-- Flow markers animate along the link when:
-- For flow/state pins: source pin has value AND target node was used this frame
-- For data pins: source pin was used this frame
-- Animation speed: 30 units/sec (0 when paused)
-- Marker distance: 40px (flow) or 10px (data)
-- Duration: 0.5 seconds

Construction

-- link.lua returns a constructor function:
local createLink = require('/lua/ge/extensions/flowgraph/link')
local link = createLink(graph, sourcePin, targetPin)
-- Automatically registers in graph.links and wires pinIn

Pin Wiring

-- On link creation, the target node's pinIn is wired:
rawset(self.targetNode.pinIn, targetPin.name, sourcePin)

-- For flow pins, multiple sources are tracked:
self.targetNode._mInFlow[targetPin.name] = { sourcePin1, sourcePin2, ... }

Serialization Format

-- Compact array format:
{ sourceNodeId, sourcePinName, targetNodeId, targetPinName, hidden_or_nil }

See Also

  • Flowgraph Base Module - Related reference
  • Flowgraph Base State Node - Related reference
  • Flowgraph Base Node - Related reference
  • FlowGraph Guide - Guide

Flowgraph Group Helper

Helper class for grouping and ungrouping nodes in the flowgraph editor. Handles converting selected nodes into subgraphs, computing bounding rectangles, centering node layouts, and managing link re-ro

Flowgraph Manager

Top-level controller for a single flowgraph project. Manages multiple graphs (parent-child hierarchy), unique ID allocation, execution lifecycle (start/stop/pause), editor integration, node selection,

On this page

PurposeClass (C) - Key MethodsLink PropertiesFlow AnimationConstructionPin WiringSerialization FormatSee Also