OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: srk on 26 Jun 2006, 10:07:44
-
What is the command to check vehicle's altitude?
-
read the comref (http://www.ofpec.com/COMREF/).
-
read the comref (http://www.ofpec.com/COMREF/).
...where you will find that it is the getpos command and the usage in this case would be something like
altitude = getpos mychopper select 2
:)
-
I thought it would be much easier. ??? But anyway, thanks.
-
a unit's position is described using three numbers : west/east, north/south, and height. another way of writing this is [x,y,z], which is what a positional array looks like.
to get a unit's positional array you use the getpos command.
to get at the values in an array you use the select command. arrays begin at 0 for the first value, 1 for the next value, and so on.
getpos unit select 0 would give its west/east or x coordinate.
getpos unit select 1 would give its north/south or y coordinate.
getpos unit select 2 would give its height or z coordinate.
what is difficult about that?