getRoadInfo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ": PositionASL" to ": Array format PositionASL") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 6: | Line 6: | ||
|gr1= Roads and Airports | |gr1= Roads and Airports | ||
|descr=Returns road | |descr= Returns road piece information. | ||
{{Feature | | {{Feature|informative| | ||
* 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" value. 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 {{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 25: | Line 27: | ||
* isBridge: [[Boolean]] - when [[true]] road segment is a bridge | * isBridge: [[Boolean]] - when [[true]] road segment is a bridge | ||
|x1= < | |x1= <sqf> | ||
private _info = getRoadInfo _road; | |||
[ | _info params ["_mapType", "_width", "_isPedestrian", "_texture", "_textureEnd", "_material", "_begPos", "_endPos", "_isBridge"]; | ||
private _roadDirection = _begPos getDir _endPos; | |||
</sqf> | |||
|seealso= [[nearRoads]] [[roadsConnectedTo]] [[isOnRoad]] [[roadAt]] [[nearestTerrainObjects]] | |seealso= [[nearRoads]] [[roadsConnectedTo]] [[isOnRoad]] [[roadAt]] [[nearestTerrainObjects]] | ||
}} | }} |
Revision as of 11:57, 4 May 2022
Description
- Description:
- Returns road piece information.
- 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 "HIDE", "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: Array format PositionASL - start of the road segment
- endPos: Array format PositionASL - finish of the road segment
- isBridge: Boolean - when true road segment is a bridge
Examples
- Example 1:
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