API ReferenceGE Extensionsflowgraphnodesvehicle
Keep Vehicle
- **Node Name:** `Keep Vehicle`
Overview
- Node Name:
Keep Vehicle - Category:
once_instant - File:
extensions/flowgraph/nodes/vehicle/keep.lua
Marks a vehicle to be kept after the flowgraph stops. By default, vehicles spawned during flowgraph runtime are removed when the flowgraph ends. This node overrides that behavior for a specific vehicle.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to affect |
keep | bool | true to keep the vehicle after flowgraph stops, false to allow removal |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Calls self.mgr.modules.vehicle:setKeepVehicle(vehId, keepValue) and forwards flow |
How It Works
- When triggered, the node reads the vehicle ID and keep flag from input pins.
- If a valid
vehIdis provided, it callsself.mgr.modules.vehicle:setKeepVehicle(vehId, keep). - This marks the vehicle in the flowgraph's vehicle module so it won't be cleaned up when the flowgraph execution ends.
- Flow is forwarded to the output.
Usage Example
-- In a flowgraph:
-- [Spawn Vehicle] → vehId → [Keep Vehicle (keep=true)] → [Continue]
-- The spawned vehicle will persist after the flowgraph stops.
-- To allow cleanup again:
-- [Keep Vehicle (keep=false)] ← vehId
-- Underlying call:
-- self.mgr.modules.vehicle:setKeepVehicle(vehId, true)Key Dependencies
self.mgr.modules.vehicle:setKeepVehicle()- marks a vehicle for retention or cleanup in the flowgraph vehicle module
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