Home   Help Search Login Register  

Author Topic: When Chopper Reaches Certain Height...  (Read 475 times)

0 Members and 1 Guest are viewing this topic.

Scratchdat

  • Guest
When Chopper Reaches Certain Height...
« 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?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:When Chopper Reaches Certain Height...
« Reply #1 on: 24 Mar 2003, 22:58:38 »
"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.  :)
Plenty of reviewed ArmA missions for you to play

Scratchdat

  • Guest
Re:When Chopper Reaches Certain Height...
« Reply #2 on: 24 Mar 2003, 23:09:40 »
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?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:When Chopper Reaches Certain Height...
« Reply #3 on: 24 Mar 2003, 23:50:16 »
yep, that's it ... I think distance works vertically.    

anyway try it and see if it does what you want  :)
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:When Chopper Reaches Certain Height...
« Reply #4 on: 25 Mar 2003, 07:32:51 »
The exact way would be

#loop
_height = getpos chopper select 2
?_height > 20: goto "whatever"
~1
goto "loop"
Not all is lost.

Scratchdat

  • Guest
Re:When Chopper Reaches Certain Height...
« Reply #5 on: 25 Mar 2003, 17:17:49 »
Thanks guys both way worked  ;D