getRoadInfo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " |r1=[[" to " |r1= [[") |
Lou Montana (talk | contribs) m (Text replacement - "<tt>([a-zA-Z0-9\. _"']+)<\/tt>" to "{{hl|$1}}") |
||
Line 7: | Line 7: | ||
|descr=Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge] | |descr=Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge] | ||
{{Feature | 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 | {{Feature | 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 {{hl|"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.}} | ||
{{Feature | Informative | Pedestrian roads `mapType` is usually | {{Feature | Informative | Pedestrian roads `mapType` is usually {{hl|"TRAIL"}}. They are part of Road Net but excluded from path finding. Use [[roadsConnectedTo]] with alternative flag to find the connections between pedestrian roads.}} | ||
|s1= [[getRoadInfo]] road | |s1= [[getRoadInfo]] road | ||
Line 15: | Line 15: | ||
|r1= [[Array]] in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge], where: | |r1= [[Array]] in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge], where: | ||
* mapType: [[String]] - road segment type, could be | * mapType: [[String]] - road segment type, could be {{hl|"ROAD"}}, {{hl|"MAIN ROAD"}}, {{hl|"TRACK"}}, {{hl|"TRAIL"}} (see [[nearestTerrainObjects]]) | ||
* width: [[Number]] - road segment width | * width: [[Number]] - road segment width | ||
* isPedestrian: [[Boolean]] - when [[true]] road is for pedestrian use only | * isPedestrian: [[Boolean]] - when [[true]] road is for pedestrian use only |
Revision as of 23:46, 15 November 2021
Description
- Description:
- Returns road info in format [mapType, width, isPedestrian, texture, textureEnd, material, begPos, endPos, isBridge]
- 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
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