Arma 3 Scripting

Command in Roads and Airports

roadsConnectedTo

Also available as Markdown and JSON, or read the original wiki page.

Description

Find the road segments connected to the given road segment.

Important

  • Pedestrian roads such as "TRAIL"s are missing connection information by design, therefore the primary syntax will return empty array for those - use the alternative syntax to return pedestrian roads.
  • Road connection is not bidirectional; e.g road segment Y can be connected to road segment Z, but road segment Z can lack a connection with road segment Y.

Syntax

Syntax 1

roadsConnectedTo roadSegment

Parameters:

Returns: Array of Objects - connected road segments

Syntax 2

since arma3 2.00

roadsConnectedTo [roadSegment, extended]

Parameters:

Returns: Array of Objects - connected road segments

Examples

Example 1

_road = (player nearRoads 50) select 0;
_connectedRoads = roadsConnectedTo _road;

Example 2

_road = (player nearRoads 50) select 0;
_connectedRoadsIncPedestrian = roadsConnectedTo [_road, true];

See also

nearRoads · isOnRoad · roadAt · surfaceIsWater · getRoadInfo · nearestTerrainObjects