nearRoads: Difference between revisions

From Bohemia Interactive Community
(MP argument, formatting, added examples/see also, formatting note)
m (Text replacement - " +\]" to "]")
 
(74 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
|version2= 1.50


|arg= global|= Arguments in MP
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| Find the road segments within the circle of given radius. |= Description
|game4= arma3
____________________________________________________________________________________________
|version4= 0.50


| pos '''nearRoads''' radius |= Syntax
|gr1= Roads and Airports


|p1= pos: [[Object]] or [[Array]] - format [[Position]], center of search radius |= PARAMETER1
|gr2= Object Detection


|p2= radius: [[Number]] - search radius in meters |= PARAMETER2
|descr= Find the road segments within the circle of given radius.


|p3= |= PARAMETER3
|s1= pos [[nearRoads]] radius


| [[Array]] of [[Object]]s - road segments within radius|= RETURNVALUE
|p1= pos: [[Object]] or [[Array]] in format [[Position#PositionAGL|PositionAGL]] or [[Position#Introduction|Position2D]] - center of search radius


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


|x1= <code>_list = [[player]] [[nearRoads]] 50;</code>|= EXAMPLE1
|r1= [[Array]] of [[Object]]s - road segments within radius


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


|x3= <code>_list = [1800,5700] [[nearRoads]] 50;</code>|= EXAMPLE3
|x2= <sqf>_list = (position _unit) nearRoads 50;</sqf>


____________________________________________________________________________________________
|x3= <sqf>_list = [1800,5700] nearRoads 50;</sqf>


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


|  |= MPBEHAVIOUR
<dl class="command_description">
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
<dt></dt>
<dl class='command_description'>
<dd class="notedate">Posted on 26 Mar, 2011</dd>
<!-- Note Section BEGIN -->
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt>
<dd class="notedate">Posted on 26 Mar, 2011
<dd class="note">
<dt class="note">'''[[User:Tankbuster|Tankbuster ]]'''<dd class="note">
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.
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.
Click below for picture.
[http://i156.photobucket.com/albums/t16/pauleden/gaming/nearroadsbig.jpg]
<!-- Note Section END -->
</dl>
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 18:15, 8 November 2023

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:
isOnRoad roadAt surfaceIsWater roadsConnectedTo findNearestEnemy nearestBuilding nearestObject nearestObjects nearObjects nearestLocation nearEntities nearTargets nearSupplies nearestLocationWithDubbing nearObjectsReady getRoadInfo nearestTerrainObjects nearestMines

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
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.