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
Accumulator (Flowgraph Node)Ease (Flowgraph Node)Increaser (Flowgraph Node)Expression (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 Extensionsflowgraphnodesmath

Accumulator (Flowgraph Node)

- **Node Name:** `Accumulator`

Overview

  • Node Name: Accumulator
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/math/accumulator.lua

Adds together values whenever triggered. Maintains a running sum that can be reset back to a default value.

Pin Schema

Input Pins

PinTypeDescription
addflowTriggering this pin adds the value pin's amount to the internal sum
resetflow (impulse)Resets the internal sum back to the default reset value
valuenumberValue to add to the stack (default is 1)

Output Pins

PinTypeDescription
changedflow (impulse)Fires when the internal value has changed
resultnumberThe current accumulated sum

Internals

FieldPurpose
self.data.currentSumRunning total of accumulated values
self.data.resetValueValue to reset to (default 0)

How It Works

  1. On execution start, currentSum is set to resetValue and output is updated.
  2. Each frame, if reset is triggered, the sum resets to resetValue (reset has priority over add).
  3. If add is triggered, the input value (or 1 if nil) is added to the sum, and changed fires.
  4. On execution stop or deserialization, currentSum resets to resetValue.

The node displays the current sum in its middle area via ImGui.

Lua Example

-- Flowgraph usage: counting laps
-- Connect a trigger zone's "entered" flow → add pin
-- value pin = 1 (default)
-- result pin → UI display showing lap count
-- reset flow → connected to race restart

Key Dependencies

  • ui_imgui - for rendering the current value in the node editor
  • _flowgraph_createNode() - standard flowgraph node registration

Additional Methods

C:_executionStarted()

Called when graph execution starts. Used for initialization/reset.

C:_executionStopped()

Called when graph execution stops. Used for cleanup.

C:_onDeserialized()

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

C:drawMiddle(builder, style)

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

Parameters:

  • builder
  • style

C:init()

Initializes the node, setting up pins and default properties.

C:work()

Main work function called each frame/tick when the node is active.


See Also

  • Ease (Flowgraph Node) - Related reference
  • Increaser (Flowgraph Node) - Related reference
  • Expression (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

I/O (Flowgraph Node)

- **Node Name:** `I/O`

Ease (Flowgraph Node)

- **Node Name:** `Ease`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsHow It WorksLua ExampleKey DependenciesAdditional MethodsC:_executionStarted()C:_executionStopped()C:_onDeserialized()C:drawMiddle(builder, style)C:init()C:work()See Also