OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: srk on 26 Jun 2006, 10:07:44

Title: Checking vehicle's altitude
Post by: srk on 26 Jun 2006, 10:07:44
What is the command to check vehicle's altitude?
Title: Re: Checking vehicle's altitude
Post by: bedges on 26 Jun 2006, 10:38:36
read the comref (http://www.ofpec.com/COMREF/).
Title: Re: Checking vehicle's altitude
Post by: Artak on 26 Jun 2006, 18:50:25
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

 :)

Title: Re: Checking vehicle's altitude
Post by: srk on 26 Jun 2006, 18:54:45
I thought it would be much easier. ??? But anyway, thanks.
Title: Re: Checking vehicle's altitude
Post by: bedges on 26 Jun 2006, 19:32:56
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?