getRoadInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " 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


| arma3 |Game name=
| arma3


|2.00 |Game version=
|2.00


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


|Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge]
|Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge]
<br><br>
<br><br>
{{Informative | The bridges are special case. Only large bridges are part of Road Net. Small pedestrian bridges are not recognized as roads. Bridge `mapType` is <tt>"ROAD"</tt> so the best way to detect bridges is to check `isBridge` boolean. Bridges are not part of new roads and don't have the same info as other new roads, so only `mapType`, `texture` (maybe `textureEnd`), `begPos`, `endPos` and `isBridge` are  updated.}}
{{Informative | The bridges are special case. Only large bridges are part of Road Net. Small pedestrian bridges are not recognized as roads. Bridge `mapType` is <tt>"ROAD"</tt> so the best way to detect bridges is to check `isBridge` boolean. Bridges are not part of new roads and don't have the same info as other new roads, so only `mapType`, `texture` (maybe `textureEnd`), `begPos`, `endPos` and `isBridge` are  updated.}}
{{Informative | Pedestrian roads `mapType` is usually <tt>"TRAIL"</tt>. They are part of Road Net but excluded from path finding. Use [[roadsConnectedTo]] with alternative flag to find the connections between pedestrian roads.}} |DESCRIPTION=
{{Informative | Pedestrian roads `mapType` is usually <tt>"TRAIL"</tt>. They are part of Road Net but excluded from path finding. Use [[roadsConnectedTo]] with alternative flag to find the connections between pedestrian roads.}}


| [[getRoadInfo]] road |SYNTAX=
| [[getRoadInfo]] road


|p1= road: [[Object]] |PARAMETER1=
|p1= road: [[Object]]


| [[Array]] in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge], where:
| [[Array]] in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge], where:
Line 26: Line 26:
* endPos: [[PositionASL]] - finish of the road segment
* endPos: [[PositionASL]] - finish of the road segment
* isBridge: [[Boolean]] - when [[true]] road segment is a bridge
* isBridge: [[Boolean]] - when [[true]] road segment is a bridge
|RETURNVALUE=




|x1= <code>[[getRoadInfo]] _road</code>|EXAMPLE1=
 
|x1= <code>[[getRoadInfo]] _road</code>
|x2= Get direction of the road segment:<code>[[private]] _info = [[getRoadInfo]] _road;
|x2= Get direction of the road segment:<code>[[private]] _info = [[getRoadInfo]] _road;
[[private]] _dir = (_info [[select]] 6) [[getDir]] (_info [[select]] 7);</code>|EXAMPLE2=
[[private]] _dir = (_info [[select]] 6) [[getDir]] (_info [[select]] 7);</code>


| [[nearRoads]] [[roadsConnectedTo]] [[isOnRoad]] [[roadAt]] [[nearestTerrainObjects]]|SEEALSO=
| [[nearRoads]] [[roadsConnectedTo]] [[isOnRoad]] [[roadAt]] [[nearestTerrainObjects]]


}}
}}

Revision as of 01:42, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge]

The bridges are special case. Only large bridges are part of Road Net. Small pedestrian bridges are not recognized as roads. Bridge `mapType` is "ROAD" so the best way to detect bridges is to check `isBridge` boolean. Bridges are not part of new roads and don't have the same info as other new roads, so only `mapType`, `texture` (maybe `textureEnd`), `begPos`, `endPos` and `isBridge` are updated.
Pedestrian roads `mapType` is usually "TRAIL". They are part of Road Net but excluded from path finding. Use roadsConnectedTo with alternative flag to find the connections between pedestrian roads.
Groups:
Roads and Airports

Syntax

Syntax:
getRoadInfo road
Parameters:
road: Object
Return Value:
Array in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge], where:
  • mapType: String - road segment type, could be "ROAD", "MAIN ROAD", "TRACK", "TRAIL" (see nearestTerrainObjects)
  • width: Number - road segment width
  • isPedestrian: Boolean - when true road is for pedestrian use only
  • texture: String - road segment surface texture
  • textureEnd: String - road segment surface texture
  • material: String - road segment surface material
  • begPos: PositionASL - start of the road segment
  • endPos: PositionASL - finish of the road segment
  • isBridge: Boolean - when true road segment is a bridge

Examples

Example 1:
getRoadInfo _road
Example 2:
Get direction of the road segment:private _info = getRoadInfo _road; private _dir = (_info select 6) getDir (_info select 7);

Additional Information

See also:
nearRoads roadsConnectedTo isOnRoad roadAt 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

Bottom Section