roadsConnectedTo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1= Roads and Airports | |gr1= Roads and Airports | ||
| Find the road segments connected to the given road segment. | | Find the road segments connected to the given road segment. | ||
{{Important | Pedestrian roads such as <tt>"TRAIL"</tt>s are missing connection information by design, therefore basic command will return empty array for those. Use the alternative syntax to return pedestrian roads.}} | {{Important | Pedestrian roads such as <tt>"TRAIL"</tt>s are missing connection information by design, therefore basic command will return empty array for those. Use the alternative syntax to return pedestrian roads.}} | ||
| '''roadsConnectedTo''' roadSegment | | '''roadsConnectedTo''' roadSegment | ||
|p1= roadSegment: [[Object]] - road segment | |p1= roadSegment: [[Object]] - road segment | ||
| [[Array]] of [[Object]]s - connected road segments | | [[Array]] of [[Object]]s - connected road segments | ||
|s2 = [[roadsConnectedTo]] [roadSegment, extended] {{Since|arma3|1.99.146461|y}} | |s2 = [[roadsConnectedTo]] [roadSegment, extended] {{Since|arma3|1.99.146461|y}} | ||
|p21= roadSegment: [[Object]] - road segment |PARAMETER21= | |p21= roadSegment: [[Object]] - road segment |PARAMETER21= | ||
Line 22: | Line 22: | ||
|p22= extended: [[Boolean]] - (Optional, default [[false]]) when [[true]], performs a more thorough search on top of base behaviour, slower but returns pedestrian and other missing road segments |PARAMETER22= | |p22= extended: [[Boolean]] - (Optional, default [[false]]) when [[true]], performs a more thorough search on top of base behaviour, slower but returns pedestrian and other missing road segments |PARAMETER22= | ||
|r2= [[Array]] of [[Object]]s - connected road segments | |r2= [[Array]] of [[Object]]s - connected road segments | ||
|x1= <code>_road = ([[player]] [[nearRoads]] 50) [[select]] 0; | |x1= <code>_road = ([[player]] [[nearRoads]] 50) [[select]] 0; | ||
_connectedRoads = [[roadsConnectedTo]] _road;</code> | _connectedRoads = [[roadsConnectedTo]] _road;</code> | ||
|x2= <code>_road = ([[player]] [[nearRoads]] 50) [[select]] 0; | |x2= <code>_road = ([[player]] [[nearRoads]] 50) [[select]] 0; | ||
_connectedRoadsIncPedestrian = [[roadsConnectedTo]] [_road, [[true]]];</code> | _connectedRoadsIncPedestrian = [[roadsConnectedTo]] [_road, [[true]]];</code> | ||
| [[nearRoads]], [[isOnRoad]], [[roadAt]], [[surfaceIsWater]], [[getRoadInfo]], [[nearestTerrainObjects]] | | [[nearRoads]], [[isOnRoad]], [[roadAt]], [[surfaceIsWater]], [[getRoadInfo]], [[nearestTerrainObjects]] | ||
}} | }} | ||
Revision as of 01:34, 18 January 2021
Description
- Description:
- Find the road segments connected to the given road segment.
- Groups:
- Roads and Airports
Syntax
- Syntax:
- roadsConnectedTo roadSegment
- Parameters:
- roadSegment: Object - road segment
- Return Value:
- Array of Objects - connected road segments
Alternative Syntax
- Syntax:
- roadsConnectedTo [roadSegment, extended] Template:Since
- Parameters:
- roadSegment: Object - road segment
- extended: Boolean - (Optional, default false) when true, performs a more thorough search on top of base behaviour, slower but returns pedestrian and other missing road segments
- Return Value:
- 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];
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note