position: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|game4= arma2oa |version4= 1.51 " to "|game4= arma2oa |version4= 1.50 ")
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(18 intermediate revisions by 2 users not shown)
Line 2: Line 2:


|game1= ofp
|game1= ofp
|version1=  
|version1=  


|game2= arma1
|game2= arma1
|version2= 1.00
|version2= 1.00


|game3= arma2
|game3= arma2
|version3= 1.00
|version3= 1.00


|game4= arma2oa
|game4= arma2oa
|version4= 1.50
|version4= 1.50


|game5= tkoh
|game5= tkoh
|version5= 1.00
|version5= 1.00


|game6= arma3
|game6= arma3
|version6= 0.50
|version6= 0.50


Line 28: Line 22:


|descr= Returns position of an object (alias of [[getPos]]) or location (alias of [[locationPosition]]).
|descr= Returns position of an object (alias of [[getPos]]) or location (alias of [[locationPosition]]).
 
{{Feature | Important | Do not use this command to get an object's position in 3D. See [[getPos]] for more details.}}
|s1= [[position]] object
|s1= [[position]] object


|p1= object: [[Object]]
|p1= object: [[Object]]


| [[Array]] - format [[PositionAGLS]]
|r1= [[Array]] - format [[Position#PositionAGLS|PositionAGLS]]


|s2= [[position]] location
|s2= [[position]] location
Line 39: Line 33:
|p21= location: [[Location]]
|p21= location: [[Location]]


|r2= [[Array]] - format [x,y,z], where z is <tt>-1 * [[getTerrainHeightASL]]</tt> at the location
|r2= [[Array]] - format [x,y,z], where z is {{hl|-1 * [[getTerrainHeightASL]]}} at the location
 
 
|x1= <code>[[private]] _pos = [[position]] [[player]];</code>
|x1= <sqf>private _pos = position player;</sqf>


|x2= <code>_myLocationHomePos = [[position]] myLocation;</code>
|x2= <sqf>_myLocationHomePos = position myLocation;</sqf>


|seealso= [[getPos]], [[getPosATL]], [[getPosASL]], [[getPosASLW]], [[visiblePosition]], [[getPosVisual]], [[visiblePositionASL]], [[locationPosition]]
|seealso= [[getPos]] [[getPosATL]] [[getPosASL]] [[getPosASLW]] [[visiblePosition]] [[getPosVisual]] [[visiblePositionASL]] [[locationPosition]]
}}
}}

Revision as of 11:24, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns position of an object (alias of getPos) or location (alias of locationPosition).
Do not use this command to get an object's position in 3D. See getPos for more details.
Groups:
Positions

Syntax

Syntax:
position object
Parameters:
object: Object
Return Value:
Array - format PositionAGLS

Alternative Syntax

Syntax:
position location
Parameters:
location: Location
Return Value:
Array - format [x,y,z], where z is -1 * getTerrainHeightASL at the location

Examples

Example 1:
private _pos = position player;
Example 2:
_myLocationHomePos = position myLocation;

Additional Information

See also:
getPos getPosATL getPosASL getPosASLW visiblePosition getPosVisual visiblePositionASL locationPosition

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