API ReferenceGE Extensionsflowgraphnodesmission
Select Garage Sites / Zones (Flowgraph Node)
- **Node Name:** `Select Garage Sites`
Overview
- Node Name:
Select Garage Sites - Category:
once_instant - File:
extensions/flowgraph/nodes/mission/selectGarage2GarageZones.lua - Icon: Scene icon
- Color: Scene color
Selects randomized start and destination parking spots from zone-based lists for Garage-to-Garage missions. Tracks used spots to prevent repeats.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
sitesData | table | Sites data containing parkingSpots.byName |
minDist | number | Minimum distance between start and end spots |
maxDist | number | Maximum distance between start and end spots |
Output Pins
| Pin | Type | Description |
|---|---|---|
loaded | flow (impulse) | Fires once after spots are selected |
startSpot | string | Selected start parking spot name |
endSpot | string | Selected end parking spot name |
startLocation | string | Zone name of the start location |
endLocation | string | Zone name of the end location |
Internals
self.usedStartSpots/self.usedEndSpots- arrays of used spot names. Persist across restarts (not cleared on_executionStarted).self.state-1= select,2= clear impulse.getSpotsInZones(sitesData, zoneNames)- local helper that filters parking spots by zone membership.findEndSpotForStartingSpot(startSpot, possibleEndSpots)- shuffles candidates and returns the first one within the min/max distance range, or the closest over-distance fallback.
How It Works
- Retrieves
mission.initialZonesandmission.destinationZonesfrom the activity (callsgenerateZoneLists()if missing). - Finds parking spots belonging to each zone set.
- Resets used-spot tracking if all spots have been consumed.
- Filters out previously used spots for both start and end.
- Shuffles available start spots, picks the first one.
- Calls
findEndSpotForStartingSpotto find an end spot within the distance constraints. - Sorts zone data by priority (
priocustom field) and outputs spot/zone names.
Lua Code Example
-- Wire in a Garage-to-Garage mission:
-- sitesFile → selectGarage2GarageZones (minDist=500, maxDist=3000)
-- .startSpot → navigation start
-- .endSpot → navigation destination
-- .startLocation / .endLocation → UI displayKey Dependencies
self.mgr.activity- mission instance withinitialZones,destinationZonessitesData.parkingSpots.byName- parking spot databasetableValuesAsLookupDict- BeamNG utility for set-from-array conversion
Additional Methods
C:resetData()
Node method.
C:work()
Main work function called each frame/tick when the node is active.
C:workOnce()
Called once when the node is triggered (flow-once execution).
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