isOnRoad: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
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...)
m (Some wiki formatting)
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma2
|game1= arma2
|1.00
|version1= 1.00
|arg= global


|gr1= Roads and Airports
|game2= arma2oa
|version2= 1.50


| Checks if given position is inside road segment. Same as [[roadAt]], only return is boolean instead of road object.
|game3= tkoh
|version3= 1.00


| '''isOnRoad''' position
|game4= arma3
|version4= 0.50


|p1= position: [[Object]] or [[Array]] in format [[PositionAGL]] (especially on bridges) or (since Arma 3 v1.99.146460) [[Position2D]], in which case Z will be automatically deduced as the height of the road surface
|arg= global


| [[Boolean]]
|gr1= Roads and Airports


|x1= <code>_objOnRoad = [[isOnRoad]] [[player]];</code>
|descr= Checks if given position is inside road segment. Same as [[roadAt]], only return is boolean instead of road object.


|x2= <code>_posOnRoad = [[isOnRoad]] [[ASLToAGL]] [[getPosASL]] [[player]];</code>
|s1= [[isOnRoad]] position


|p1= position: [[Object]] or [[Array]] in format [[Position#PositionAGL|PositionAGL]] (especially on bridges) or {{GVI|arma3|2.00|size= 0.75}} [[Position#Introduction|Position2D]], in which case Z will be automatically deduced as the height of the road surface


|[[nearRoads]], [[roadsConnectedTo]], [[roadAt]], [[surfaceIsWater]], [[getRoadInfo]], [[nearestTerrainObjects]]
|r1= [[Boolean]]


| |MPBEHAVIOUR=  
|x1= <sqf>_objOnRoad = isOnRoad player;</sqf>
}}


<h3 style='display:none'>Notes</h3>
|x2= <sqf>_posOnRoad = isOnRoad ASLToAGL getPosASL player;</sqf>
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[nearRoads]] [[roadsConnectedTo]] [[roadAt]] [[surfaceIsWater]] [[getRoadInfo]] [[nearestTerrainObjects]]
</dl>
}}


<h3 style='display:none'>Bottom Section</h3>
{{Note
 
|user= Tankbuster
{{GameCategory|arma2|Scripting Commands}}
|timestamp= 20171124213100
{{GameCategory|arma3|Scripting Commands}}
|text= Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad.
{{GameCategory|tkoh|Scripting Commands}}
}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on November 24, 2017 - 21:31 (UTC)</dd>
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt>
<dd class="note">
Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 15:30, 17 April 2023

Hover & click on the images for description

Description

Description:
Checks if given position is inside road segment. Same as roadAt, only return is boolean instead of road object.
Groups:
Roads and Airports

Syntax

Syntax:
isOnRoad position
Parameters:
position: Object or Array in format PositionAGL (especially on bridges) or Arma 3 logo black.png2.00 Position2D, in which case Z will be automatically deduced as the height of the road surface
Return Value:
Boolean

Examples

Example 1:
_objOnRoad = isOnRoad player;
Example 2:
_posOnRoad = isOnRoad ASLToAGL getPosASL player;

Additional Information

See also:
nearRoads roadsConnectedTo roadAt surfaceIsWater getRoadInfo nearestTerrainObjects

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
Tankbuster - c
Posted on Nov 24, 2017 - 21:31 (UTC)
Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad.