Difference between revisions of "getPosASL"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added suggestion for code optimization)
Line 35: Line 35:
 
  getPosASL obj select 2  
 
  getPosASL obj select 2  
 
might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset. The same problem exists for [[getPos]]. There was a [http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=e587356595b907e91f96b8817d7f8a26;act=ST;f=71;t=57918 discussion] thread in the BIS forums which suggested the use of the command [[modelToWorld]] instead to get around this issue where an absolute vertical position is required. ArmA Ver '''1.02'''.
 
might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset. The same problem exists for [[getPos]]. There was a [http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=e587356595b907e91f96b8817d7f8a26;act=ST;f=71;t=57918 discussion] thread in the BIS forums which suggested the use of the command [[modelToWorld]] instead to get around this issue where an absolute vertical position is required. ArmA Ver '''1.02'''.
 +
 +
<dd class="notedate">Posted on 27 Mar, 2014
 +
<dt class="note">'''[[User:Floriangeyer|Floriangeyer]]'''<dd class="note">
 +
According to [[Code Optimisation]], this function is the fastest (2x) and should be used instead of [[getPos]], [[getPosATL]] and [[position]].
  
 
<!-- Note Section END -->
 
<!-- Note Section END -->

Revision as of 21:19, 27 March 2014

Introduced with Armed Assault version 1.001.00Arguments of this scripting command don't have to be local to the client the command is executed on
Hover & click on the images for descriptions

Description

Description:
Returns the object position height above sea level.

Syntax

Syntax:
Array = getPosASL object
Parameters:
object: Object
Return Value:
Array - format PositionASL

Examples

Example 1:
_AslPosn=getPosASL player
Example 2:
hint format["position above sea level: %1",(getPosASL player) select 2]

Additional Information

See also:
setPosASLsetPosASL2positiongetPosgetPosATLgetPosASLWvisiblePositionvisiblePositionASL
Groups:
Uncategorised

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.

Notes

Posted on 23 Feb, 2007
Dr_Eyeball
getPosASL obj select 2 might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset. The same problem exists for getPos. There was a discussion thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02.
Posted on 27 Mar, 2014
Floriangeyer
According to Code Optimisation, this function is the fastest (2x) and should be used instead of getPos, getPosATL and position.

Bottom Section