API ReferenceGE Extensionsflowgraphnodesscene
Collection Marker (Flowgraph Node)
- **Node Name:** `Collection Marker`
Overview
- Node Name:
Collection Marker - Category:
repeat_instant - Author: BeamNG
- File:
extensions/flowgraph/nodes/scene/collectionMarker.lua
Creates a floating, rotating, colorable BeamNG-themed collectible token in the 3D scene. The marker bobs up and down and spins continuously.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Inflow for this node |
reset | flow (impulse) | Removes the marker |
pos | vec3 | World position of the marker |
color | number or color | Optional coloring. Number 0-1 blends from Orange to Green. Also accepts RGBA color table |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Outflow for this node |
Behavior
work()- Each frame while flow is active:- On first frame, creates a
TSStaticobject usingart/shapes/collectible/s_collect_BNG.daeat scale 2x, plus aPointLight. - Updates position with a sinusoidal vertical bob (
sin(time * 1.5) * 0.15). - Applies continuous Y-axis rotation (
time * 1.75radians). - Applies color: if a number (0-1), maps through
rainbowColorfor an orange-to-green gradient. If an RGBA table, applies directly. - Updates the point light to match the marker color with radius 3.
- On first frame, creates a
hideMarker()- Deletes both theTSStaticmarker and thePointLight._executionStopped()/destroy()/onClientEndMission()- All callhideMarker()for cleanup.
Internals
self.marker- TheTSStaticcollectible mesh objectself.light- ThePointLightthat illuminates the marker- Uses
self.mgr.modules.timer.globalTime.realfor animation timing - Color number mapping uses
rainbowColor(36, (0.8 - 0.75*clr) * 12, 1)
Key Dependencies
createObject('TSStatic')- Creates the 3D mesh objectworldEditorCppApi.createObject("PointLight")- Creates the lightrainbowColor()- Color gradient utilityquatFromEuler()- Rotation from euler angles
How It Works
The node manages a collectible-style 3D token that hovers and spins at a given position. It's designed for collectathon gameplay - the marker uses the BeamNG collectible mesh and glows with a configurable color. The sinusoidal bob and constant spin create an eye-catching floating effect. Cleanup is thorough, with deletion on stop, destroy, and mission end.
Example Usage
-- Place collectible tokens around a map
-- Wire pos from scene objects or hardcoded positions
-- Use color number 0.0 (orange) through 1.0 (green) for difficulty/value indication
-- Wire reset impulse to remove the marker when collectedAdditional Methods
C:init(mgr, ...)
Initializes the node, setting up pins and default properties.
Parameters:
mgr...
See Also
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- Get Player Vehicle ID (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide