roadAt: 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 | ||
| arma3 | | arma3 | ||
|1.58 | |1.58 | ||
|arg= global | |arg= global | ||
|gr1= Roads and Airports | |gr1= Roads and Airports | ||
| Returns a road segment containing given position, [[objNull]] otherwise. Same as [[isOnRoad]] only returns the actual road object instead of boolean. | | Returns a road segment containing given position, [[objNull]] otherwise. Same as [[isOnRoad]] only returns the actual road object instead of boolean. | ||
| '''roadAt''' position | | '''roadAt''' position | ||
|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 | |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 | ||
| [[Object]] - road segment or [[objNull]] | | [[Object]] - road segment or [[objNull]] | ||
|x1= <code>_road = [[roadAt]] [[ASLToAGL]] [[getPosASL]] [[player]];</code> | |x1= <code>_road = [[roadAt]] [[ASLToAGL]] [[getPosASL]] [[player]];</code> | ||
|x2= <code>_isOnRoad = ![[isNull]] [[roadAt]] [[player]];</code> | |x2= <code>_isOnRoad = ![[isNull]] [[roadAt]] [[player]];</code> | ||
|x3= For detecting bridges, for example<code>[[getModelInfo]] ([[roadAt]] [[ASLToAGL]] [[getPosASL]] [[player]]); {{cc|["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",true]}}</code> | |x3= For detecting bridges, for example<code>[[getModelInfo]] ([[roadAt]] [[ASLToAGL]] [[getPosASL]] [[player]]); {{cc|["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",true]}}</code> | ||
| [[nearRoads]], [[roadsConnectedTo]], [[isOnRoad]], [[surfaceIsWater]], [[getRoadInfo]], [[nearestTerrainObjects]] | | [[nearRoads]], [[roadsConnectedTo]], [[isOnRoad]], [[surfaceIsWater]], [[getRoadInfo]], [[nearestTerrainObjects]] | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= |
Revision as of 01:20, 18 January 2021
Description
- Description:
- Returns a road segment containing given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean.
- Groups:
- Roads and Airports
Syntax
- Syntax:
- roadAt position
- Parameters:
- 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
- Return Value:
- Object - road segment or objNull
Examples
- Example 1:
_road = roadAt ASLToAGL getPosASL player;
- Example 2:
_isOnRoad = !isNull roadAt player;
- Example 3:
- For detecting bridges, for example
getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",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