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
Format String (Flowgraph Node)Match String (Flowgraph Node)Concat (Flowgraph Node)SubString (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 Extensionsflowgraphnodesstring

Format String (Flowgraph Node)

- **Node Name:** `Format String`

Overview

  • Node Name: Format String
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/string/format.lua

Formats a string using Lua's string.format with up to 16 input values.

Pin Schema

Input Pins

PinTypeDescription
value_1 .. value_NanyValues to insert into the format pattern (dynamic, up to 16)

Output Pins

PinTypeDescription
valuestringThe formatted result string

Data Properties

PropertyTypeDefaultDescription
patternstring"%d"Lua format string (e.g. "%s has %d points")

Behavior

  • init() - Sets default pattern to "%d" and count to 1.
  • postInit() - Creates initial input pins based on count.
  • work() - Calls string.format(pattern, value_1, value_2, ...) with the current count of values. Uses a large if/elseif chain for 1–16 arguments.
  • updatePins(old, new) - Adds or removes input pins when the count changes. Cleans up links to removed pins.

Properties Editor

  • Count - Integer input to set how many value_N input pins exist (minimum 1, maximum 16).

Serialization

  • _onSerialize(res) - Saves count.
  • _onDeserialized(res) - Restores count and recreates pins.

How It Works

  1. Set the pattern data property to a Lua format string.
  2. Adjust the count to match the number of format placeholders.
  3. Connect values to the value_1, value_2, etc. input pins.
  4. The output value pin receives the formatted string each frame.
-- Example: pattern = "Player %s scored %d points"
-- value_1 = "Alice" (string)
-- value_2 = 42 (number)
-- Output: "Player Alice scored 42 points"

Limitations

  • Maximum of 16 input values (hardcoded if/elseif chain).
  • Uses Lua's standard string.format specifiers (%d, %s, %f, etc.).

Key Dependencies

  • Lua built-in string.format

Additional Methods

C:drawCustomProperties()

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

C:drawMiddle(builder, style)

Custom ImGui drawing in the middle section of the node in the editor.

Parameters:

  • builder
  • style

See Also

  • Match String (Flowgraph Node) - Related reference
  • Concat (Flowgraph Node) - Related reference
  • SubString (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Get Transition Variables (Flowgraph Node)

- **Node Name:** `Get Transition Variables`

Match String (Flowgraph Node)

- **Node Name:** `Match String`

On this page

OverviewPin SchemaInput PinsOutput PinsData PropertiesBehaviorProperties EditorSerializationHow It WorksLimitationsKey DependenciesAdditional MethodsC:drawCustomProperties()C:drawMiddle(builder, style)See Also