API ReferenceGE Extensionsflowgraphnodesgameplaytraffic
Spawn Vehicle Group
**File:** `flowgraph/nodes/gameplay/traffic/trafficSpawnGroup.lua`
File: flowgraph/nodes/gameplay/traffic/trafficSpawnGroup.lua
Description: Spawns a group of vehicles; use the Set Vehicle Group node for the group data.
Tags: spawn, vehicle, group, traffic, multispawn
Input Pins
| Name | Type | Description |
|---|---|---|
flow | flow | |
reset | flow | Deletes group vehicles and resets this node. |
group | table | Vehicle group data; if none given, the default traffic group will spawn. |
quantity | number | Number of new vehicles to spawn; set to -1 to use traffic value from the game settings. |
shuffle | bool | If true, randomize the spawning order of the group. |
spawnMode | string | Spawn mode; see Node Properties for list. |
spawnGap | number | Distance between vehicle spawn points. |
startPos | vec3 | Base position to start spawning from. |
startRot | quat | Base rotation to start spawning from. |
randomColors | bool | If true, vehicles will spawn with randomly selected colors. |
dontDelete | bool | If true, the vehicle will not be deleted when you stop the project. |
Output Pins
| Name | Type | Description |
|---|---|---|
flow | flow | |
loaded | flow | Flows when the vehicle group is loaded. |
vehicleIds | table | Table of newly spawned vehicle ids. |
Methods
C:init()C:_executionStopped()C:onNodeReset()C:resetState()C:postInit()C:onVehicleGroupSpawned(vehIds, groupId)C:work()
See Also
- Add Vehicle (Traffic) - Related reference
- Traffic Driving Stats - Related reference
- File Vehicle Group - Related reference
- FlowGraph Guide - Guide