OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Scratchdat on 24 Mar 2003, 22:50:50
-
Simple question, should b easy 4 u clever ppl to answer ;)
I just wanna make an event happen when my chopper reaches 20 metres height.
I tried using this (name of chopper is rah)
?(height rah > 20): goto "whatever"
but it didn't work.
Any ideas?
-
"height" isn't a command, so it wouldn't work. ;) In this sort of circumstance you should always check the command ref, to see what it can tell you.
I can't remember the easiest way to do what you are trying to do ... and it depends whether you want height above the ground or above sea level. The basic principle is to set a game logic or trigger at the relevant place and measure the difference in y coordinate between the two. (OFP calls height the y coordinate - it goes [x,z,y])
I have a feeling that triggers are always at sea level, and GLs are at ground level, but don't quote me. Search the forum, this has come up before. :)
-
That sound like a good idea.
So how about if i put a game logic (gl) on the ground under the chopper.
?(rah distance gl > 20):goto "whatever"
I know that probably aint how the distance command works but do u get what i'm sayin?
-
yep, that's it ... I think distance works vertically.
anyway try it and see if it does what you want :)
-
The exact way would be
#loop
_height = getpos chopper select 2
?_height > 20: goto "whatever"
~1
goto "loop"
-
Thanks guys both way worked ;D