API ReferenceGE Extensionsflowgraphnodesvehicle
Is Coupled
- **Node Name:** `Is Coupled`
Overview
- Node Name:
Is Coupled - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/isCoupled.lua
Detects whether two vehicles are coupled (attached via coupler - e.g., tow hitch, fifth wheel). Outputs both flow pins and a boolean for branching.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehA | number | ID of vehicle A |
vehB | number | ID of vehicle B |
Output Pins
| Pin | Type | Description |
|---|---|---|
coupled | flow | Active when the vehicles are coupled |
decoupled | flow | Active when the vehicles are not coupled |
isCoupled | bool | True if the vehicles are coupled |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Calls self.mgr.modules.vehicle:isCoupledTo(vehA, vehB) and sets all three output pins |
How It Works
- Each frame, the node queries the flowgraph vehicle module to check if vehicle A is coupled to vehicle B.
- The
coupledflow pin is active when they are attached. - The
decoupledflow pin is active when they are not attached. - The
isCoupledboolean pin mirrors the coupled state.
Usage Example
-- In a flowgraph:
-- [Is Coupled] ← vehA ← [Truck ID]
-- ← vehB ← [Trailer ID]
-- → (coupled) → [Coupled logic]
-- → (decoupled) → [Decoupled logic]
-- The underlying check uses the flowgraph vehicle module:
-- self.mgr.modules.vehicle:isCoupledTo(truckId, trailerId)Key Dependencies
self.mgr.modules.vehicle:isCoupledTo()- checks coupling state between two vehicles 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