API ReferenceGE Extensionsflowgraphnodesvehicle
Random Config Provider
- **Node Name:** `Random Config Provider`
Overview
- Node Name:
Random Config Provider - Category:
once_instant - File:
extensions/flowgraph/nodes/vehicle/randomConfigProvider.lua
Provides a random vehicle configuration from the available vehicles. Filters to cars with a top speed above 10, and randomly selects a model, config, and paint color.
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
model | string | The model key of the selected vehicle |
config | string | The config key of the selected vehicle |
name | string (hidden) | The model name of the selected vehicle |
color | color (hidden) | A randomly selected paint from the model's available paints |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Initializes empty model/config tables, sets vehType to 'Car' |
_executionStarted() | Builds the options list from all available vehicles (cached) |
workOnce() | Randomly picks a model, config, and paint from the options |
Options Building (_executionStarted)
The node builds a list of eligible vehicles on first execution:
- Fetches all vehicles via
core_vehicles.getVehicleList().vehicles. - Filters to vehicles where
model.Type == 'Car'. - For each car model, collects configs with
Top Speed > 10. - Extracts available paint names from the model data.
- Only includes models that have at least one qualifying config.
How It Works
- On execution start, builds a cached list of car models with their configs and paints.
- When
workOnce()runs, it randomly selects:- A model from the options list
- A config from that model's configs
- A paint color from the model's available paints (if any)
- Outputs the selected model key, config key, display name, and paint.
Usage Example
-- In a flowgraph - spawn a random car:
-- [Random Config Provider] → (model) → [Spawn Vehicle].model
-- → (config) → [Spawn Vehicle].config
-- → (color) → [Spawn Vehicle].color
-- The underlying Lua for random selection:
local vehs = core_vehicles.getVehicleList().vehicles
-- Filter to cars, pick random model + config
local model = vehs[math.random(#vehs)]
local config = model.configs[math.random(#model.configs)]Key Dependencies
core_vehicles.getVehicleList()- retrieves all available vehicle datacore_vehicles.getModel()/core_vehicles.getConfig()- vehicle metadata access
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide