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
ARunForLife (Flowgraph Node)Clear Lights Drag Race (Flowgraph Node)Countdown Lights Controller (Flowgraph Node)Get Custom Vehicle Data (Flowgraph Node)Get Mission Setup Data (Flowgraph Node)Check Players Position / Go To Start Line (Flowgraph Node)KnockAway Check (Flowgraph Node)Lights Controller (Flowgraph Node)Mission Post Clean (Flowgraph Node)Mission Cleanup / Pre Clean (Flowgraph Node)Prepare Vehicle (Flowgraph Node)Remove Stashed Player Vehicle (Flowgraph Node)Select Garage Vehicle (Flowgraph Node)Select Garage Sites / Zones (Flowgraph Node)Select Garage Spots (Flowgraph Node)Select Heist Spots (Flowgraph Node)Set Stage Lights (Flowgraph Node)Update Display Drag Race (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 Extensionsflowgraphnodesmission

Lights Controller (Flowgraph Node)

- **Node Name:** `Lights Controller`

Overview

  • Node Name: Lights Controller
  • Category: repeat_instant
  • File: extensions/flowgraph/nodes/mission/lightsController.lua
  • Icon: AI icon
  • Color: AI color

Controls the Christmas-tree countdown light sequence for drag-race missions. Supports both Pro Tree (all ambers flash simultaneously) and Sportsman Tree (ambers illuminate sequentially). Also detects jump starts and triggers disqualification.

Pin Schema

Input Pins

PinTypeDefaultDescription
flowflow-Inflow for this node
resetflow (impulse)-Resets the countdown state and hides all lights
proTreebooltrueUse Pro Tree (simultaneous amber) vs Sportsman Tree (sequential)
velocitynumber-Current velocity of the player's vehicle

Output Pins

PinTypeDescription
flowflowAlways-on outflow
disqualifiedflowActive if the player jump-started
startedflowActive once the green light is shown

Internals

  • self.lights - table of scene-tree light objects, split into stageLights (pre-stage / stage) and countDownLights (amber 1-3, green, red, left + right).
  • self.starttimer - elapsed simulation time since the sequence began (incremented by self.mgr.dtSim).
  • self.jumpStarted - bool, set when the player moves (velocity > 0.5) before green.
  • self.started - bool, set when the green light appears.

initLights()

Looks up all scene-tree objects by name (e.g. "Prestagelight_l", "Amberlight1_R", "Greenlight_L").

How It Works

  1. Reset - When the reset impulse fires, all lights are hidden, timers and flags are zeroed.
  2. Pro Tree sequence (all ambers at once):
    • t > 2.0s → Show all six amber lights (L + R).
    • t > 2.4s → Hide ambers, show green. If no jump start, mark started = true.
  3. Sportsman Tree sequence (sequential):
    • t > 1.0s → Amber 1
    • t > 1.5s → Amber 2 (hide amber 1)
    • t > 2.0s → Amber 3 (hide amber 2)
    • t > 2.5s → Green (hide amber 3), mark started = true.
  4. Jump start detection - If the player's velocity exceeds 0.5 before the green light, jumpStarted is set. Right-side lights stay amber, the red light is shown, and disqualified fires. The left-side sequence continues normally but started is never set.

Lua Code Example

-- Typical flowgraph wiring:
-- 1. Connect vehicle velocity sensor → lightsController.velocity
-- 2. Connect a trigger zone → lightsController.reset (to begin countdown)
-- 3. lightsController.started → race timer / checkpoint system
-- 4. lightsController.disqualified → fail state / restart prompt

Key Dependencies

  • scenetree.findObject(name) - requires named light objects in the scene (e.g. "Amberlight1_L")
  • self.mgr.dtSim - simulation delta time from the flowgraph manager

Additional Methods

C:_executionStarted()

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

C:work()

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


See Also

  • ARunForLife (Flowgraph Node) - Related reference
  • Update Display Drag Race (Flowgraph Node) - Related reference
  • Clear Lights Drag Race (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

KnockAway Check (Flowgraph Node)

- **Node Name:** `KnockAway Check`

Mission Post Clean (Flowgraph Node)

- **Node Name:** `Mission Post Clean`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsinitLights()How It WorksLua Code ExampleKey DependenciesAdditional MethodsC:_executionStarted()C:work()See Also