API ReferenceGE Extensionsflowgraphnodesmission
Select Garage Vehicle (Flowgraph Node)
- **Node Name:** `Select Garage Vehicle`
Overview
- Node Name:
Select Garage Vehicle - Category:
once_instant - File:
extensions/flowgraph/nodes/mission/selectGarage2GarageVehicle.lua - Icon: Vehicle icon
- Color: Vehicle color
Selects a random vehicle configuration from available mission options, with used-config tracking to avoid repeats until all configs have been used.
Pin Schema
Input Pins
None (reads vehicle options from the mission instance).
Output Pins
| Pin | Type | Description |
|---|---|---|
loaded | flow (impulse) | Fires once after a vehicle is selected |
model | string | Selected vehicle model name |
config | string | Selected vehicle config name |
name | string | Formatted vehicle name for UI display |
Internals
self.usedConfigs-{[model] = {[config] = true}}lookup table tracking already-used configurations. Persists across execution restarts (not cleared on_executionStarted).self.state- two-phase state machine:1= select,2= clear impulse.getAllAvailableConfigs(vehicleOptions)- local helper that flattens the mission'svehicleOptionslist into{model, config, name}entries.
How It Works
- On first
work()call (state 1):- Retrieves
mission.vehicleOptionsfrom the activity, callinggenerateVehicleOptions()if needed. - Builds the full list of available configs.
- If all configs have been used, resets
usedConfigsand re-seeds the RNG. - Filters out used configs, picks a random one from the remainder.
- Outputs
model,config,nameand fires theloadedimpulse. - Advances to state 2.
- Retrieves
- On subsequent calls (state 2): clears the
loadedimpulse.
Lua Code Example
-- Garage-to-Garage mission flowgraph:
-- selectGarage2GarageVehicle.loaded → spawnVehicle (model, config from outputs)
-- Each mission attempt gets a different vehicle until all are exhausted.Key Dependencies
self.mgr.activity- current mission instancemission.vehicleOptions/mission:generateVehicleOptions()- vehicle option datamath.random,math.randomseed- randomization
Additional Methods
C:init()
Initializes the node, setting up pins and default properties.
C:resetData()
Node method.
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