BIS fnc position: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(36 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|gr1= Positions
____________________________________________________________________________________________


| <pre>/*
|descr= Returns [[Position#PositionAGL|PositionAGL]], unless passed argument is [[Array]], then the same array is returned. When position is [[Object]] and alternative position is stored in {{hl|"BIS_fnc_position_forced"}} variable on this object, the stored position is used rather than actual object position. This function is a pretty safe way to get the position of an entity.


Description:
|s1= argument call [[BIS_fnc_position]]
Return position


Parameter(s):
|p1= argument - could be one of:
_this:
* [[Array]] - Position in format {{hl|[x, y]}} or {{hl|[x, y ,z]}}
ARRAY - position in format [x,y] or [x,y,z]
* [[Object]] - Object
OBJECT - object
* [[Group]] - Group, group leader position is used
GROUP - group leader
* [[Location]] - Location
LOCATION - location
* [[String]] - Marker or variable name containing object
STRING - marker
{{Feature|informative|To get the position of an [[Eden Entity]] use <sqf inline>_entity get3DENAttribute "Position" select 0;</sqf>.}}
CODE - result of code


Returns:
|r1= [[Array]] - position in format {{hl|[x, y]}} or {{hl|[x, y ,z]}}
ARRAY - position in format [x,y] or [x,y,z]
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|x1= <sqf>private _pos = player call BIS_fnc_position;</sqf>
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_position]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[Position]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:position}}]]
[[Category:Functions|{{uc:position}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:position}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:position}}]]

Latest revision as of 00:24, 2 February 2024

Hover & click on the images for description

Description

Description:
Returns PositionAGL, unless passed argument is Array, then the same array is returned. When position is Object and alternative position is stored in "BIS_fnc_position_forced" variable on this object, the stored position is used rather than actual object position. This function is a pretty safe way to get the position of an entity.
Execution:
call
Groups:
Positions

Syntax

Syntax:
argument call BIS_fnc_position
Parameters:
argument - could be one of:
  • Array - Position in format [x, y] or [x, y ,z]
  • Object - Object
  • Group - Group, group leader position is used
  • Location - Location
  • String - Marker or variable name containing object
To get the position of an Eden Entity use _entity get3DENAttribute "Position" select 0;.
Return Value:
Array - position in format [x, y] or [x, y ,z]

Examples

Example 1:
private _pos = player call BIS_fnc_position;

Additional Information

See also:
Position

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