nearRoads: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "_{10,} " to "")
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|Comments=
{{Command


| arma2 |Game name=
| arma2


|1.00|Game version=
|1.00


|gr1= Roads and Airports |GROUP1=
|gr1= Roads and Airports


|gr2= Object Detection |GROUP2=
|gr2= Object Detection


| Find the road segments within the circle of given radius. |DESCRIPTION=
| Find the road segments within the circle of given radius.


| pos '''nearRoads''' radius |SYNTAX=
| pos '''nearRoads''' radius


|p1= pos: [[Object]] or [[Array]] in format [[PositionAGL]] or [[Position2D]], center of search radius |PARAMETER1=
|p1= pos: [[Object]] or [[Array]] in format [[PositionAGL]] or [[Position2D]], center of search radius


|p2= radius: [[Number]] - search radius in meters |PARAMETER2=
|p2= radius: [[Number]] - search radius in meters


|p3= |PARAMETER3=  
|p3=


| [[Array]] of [[Object]]s - road segments within radius|RETURNVALUE=
| [[Array]] of [[Object]]s - road segments within radius




|x1= <code>_list = [[player]] [[nearRoads]] 50;</code>|EXAMPLE1=
|x1= <code>_list = [[player]] [[nearRoads]] 50;</code>


|x2= <code>_list = ([[position]] _unit) [[nearRoads]] 50;</code>|EXAMPLE2=
|x2= <code>_list = ([[position]] _unit) [[nearRoads]] 50;</code>


|x3= <code>_list = [1800,5700] [[nearRoads]] 50;</code>|EXAMPLE3=
|x3= <code>_list = [1800,5700] [[nearRoads]] 50;</code>




| [[isOnRoad]], [[roadAt]], [[surfaceIsWater]], [[roadsConnectedTo]], [[findNearestEnemy]], [[nearestBuilding]], [[nearestObject]], [[nearestObjects]], [[nearObjects]], [[nearestLocation]], [[nearEntities]], [[nearTargets]], [[nearSupplies]], [[nearestLocationWithDubbing]], [[nearObjectsReady]], [[getRoadInfo]], [[nearestTerrainObjects]] |SEEALSO=
| [[isOnRoad]], [[roadAt]], [[surfaceIsWater]], [[roadsConnectedTo]], [[findNearestEnemy]], [[nearestBuilding]], [[nearestObject]], [[nearestObjects]], [[nearObjects]], [[nearestLocation]], [[nearEntities]], [[nearTargets]], [[nearSupplies]], [[nearestLocationWithDubbing]], [[nearObjectsReady]], [[getRoadInfo]], [[nearestTerrainObjects]]


|  |MPBEHAVIOUR=  
|  |MPBEHAVIOUR=  

Revision as of 01:21, 18 January 2021

Hover & click on the images for description

Description

Description:
Find the road segments within the circle of given radius.
Groups:
Roads and AirportsObject Detection

Syntax

Syntax:
pos nearRoads radius
Parameters:
pos: Object or Array in format PositionAGL or Position2D, center of search radius
radius: Number - search radius in meters
Return Value:
Array of Objects - road segments within radius

Examples

Example 1:
_list = player nearRoads 50;
Example 2:
_list = (position _unit) nearRoads 50;
Example 3:
_list = [1800,5700] nearRoads 50;

Additional Information

See also:
isOnRoadroadAtsurfaceIsWaterroadsConnectedTofindNearestEnemynearestBuildingnearestObjectnearestObjectsnearObjectsnearestLocationnearEntitiesnearTargetsnearSuppliesnearestLocationWithDubbingnearObjectsReadygetRoadInfonearestTerrainObjects

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note

Notes

Posted on 26 Mar, 2011
Tankbuster
NearRoads always gets data in the same order. In a 300 meter radius around Feruz Abad, for example, the first one is in the south-west corner and the last one is in the north-east.

Bottom Section