API ReferenceGE Extensionsflowgraphnodesmission
Select Heist Spots (Flowgraph Node)
- **Node Name:** `Select Heist Spots`
Overview
- Node Name:
Select Heist Spots - Category:
once_p_duration - File:
extensions/flowgraph/nodes/mission/selectHeistMissionSpots.lua - Icon: Scene icon
- Color: Scene color
- Author: BeamNG
Selects randomized start, heist, and escape parking spots for heist-style missions. Uses parking-spot tags to categorize locations and enforces minimum distance constraints between phases.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Trigger this node |
reset | flow (impulse) | Reset the node state |
position | vec3 | Current vehicle/player position (used for proximity filtering) |
sitesData | table | Sites data with parkingSpots.byName |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Active once all spots are resolved |
loaded | flow (impulse) | Fires once after spots are selected |
start | string | Selected start spot name |
hiest | string | Selected heist target spot name |
escape | string | Selected escape spot name |
startLocation | string | Zone name for start |
hiestLocation | string | Zone name for heist |
escapeLocation | string | Zone name for escape |
Internals
self.startLoc,self.hiestLoc,self.escapeLoc- arrays of spot names categorized by tag.self.state- 6-phase state machine for progressive spot resolution.- Spots are categorized using the first
customFields.sortedTagsentry:"start","hiest", or"escape".
How It Works
The node operates across multiple frames via a state machine:
- State 1 - Load and categorize all parking spots by tag, then shuffle each category randomly.
- State 2 - Validate start spot: must be within 400m of the player's position. Skips to next candidate if too far.
- State 3 - Validate heist spot: must be > 250m from start. Skips to next candidate if too close.
- State 4 - Validate escape spot: must be > 300m from heist. Skips to next candidate if too close.
- State 5 - Sort zones by priority and output all spot + location names. Fire
loadedimpulse. - State 6 - Steady state: keep flow active, clear impulse.
Lua Code Example
-- Heist mission flowgraph:
-- playerPosition → selectHeistMissionSpots.position
-- sitesFile → selectHeistMissionSpots.sitesData
-- .start → spawn/navigate to start
-- .hiest → navigate to heist target
-- .escape → navigate to escape pointKey Dependencies
sitesData.parkingSpots.byName- parking spot databasecustomFields.sortedTags- spot categorization tagstableKeys- BeamNG table utility
Additional Methods
C:_executionStarted()
Called when graph execution starts. Used for initialization/reset.
C:init()
Initializes the node, setting up pins and default properties.
C:resetData()
Node method.
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