locationPosition: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| arma1 \|1.([0-9]{2}) \|([^g]|g[^a])" to "| arma1 |1.$1 |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.50 |game4= tkoh |version4= 1.00 |game5= arma3 |version5= 0.50 |$2") |
Lou Montana (talk | contribs) (Fix return value) |
||
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma1 | |game1= arma1 | ||
|1.08 | |version1= 1.08 | ||
|game2= arma2 | |game2= arma2 | ||
Line 18: | Line 18: | ||
|gr1= Locations | |gr1= Locations | ||
| Returns the [[Position|position]] of a location. If the location is attached to an object, that object's position is returned. | |descr= Returns the [[Position|position]] of a location. If the location is attached to an object, that object's position is returned. | ||
| | |s1= [[locationPosition]] location | ||
|p1= location: [[Location]] | |p1= location: [[Location]] | ||
|r1= [[Array]] | |r1= [[Array]] format [[Position#PositionAGL|PositionAGL]] - as locations are placed at Z = zero [[Position#PositionASL|ASL]] the returned Z is negative on land and around zero on water, see {{Link|#Example 3}} | ||
|x1= < | |x1= <sqf>_locationPos = locationPosition myLocation;</sqf> | ||
|x2= < | |x2= <sqf> | ||
_locationPos = | _location = nearestLocation [getPos player, "nameCity"]; | ||
_locationPos = locationPosition _location; | |||
</sqf> | |||
|seealso= [[setPosition]] | |x3= <sqf> | ||
private _landLocation = locationPosition nearestLocation [[2915.2, 6164.52], "NameCityCapital"]; // "Agia Marina" [2915.2, 6164.52, -21.9009] | |||
private _waterLocation = locationPosition nearestLocation [[2647.8799, 5989.9502], "NameMarine"]; // "Marina Bay" [2647.88, 5989.95, 0.0161484] | |||
</sqf> | |||
|seealso= [[setPosition]] [[createLocation]] [[nearestLocation]] [[nearestLocations]] [[position]] [[size]] | |||
}} | }} | ||
Latest revision as of 22:25, 11 April 2023
Description
- Description:
- Returns the position of a location. If the location is attached to an object, that object's position is returned.
- Groups:
- Locations
Syntax
- Syntax:
- locationPosition location
- Parameters:
- location: Location
- Return Value:
- Array format PositionAGL - as locations are placed at Z = zero ASL the returned Z is negative on land and around zero on water, see Example 3
Examples
- Example 1:
- Example 2:
- Example 3:
- private _landLocation = locationPosition nearestLocation [[2915.2, 6164.52], "NameCityCapital"]; // "Agia Marina" [2915.2, 6164.52, -21.9009] private _waterLocation = locationPosition nearestLocation [[2647.8799, 5989.9502], "NameMarine"]; // "Marina Bay" [2647.88, 5989.95, 0.0161484]
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
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.08
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Locations