Home   Help Search Login Register  

Author Topic: Detect height  (Read 663 times)

0 Members and 2 Guests are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Detect height
« on: 28 Feb 2003, 18:30:36 »
Hi guys! Is there a way to detect a choppers height? Like if a chopper is at height 110 a trigger will activate and if he is at height 30 another trigger activates? Plz help.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detect height
« Reply #1 on: 28 Feb 2003, 18:37:39 »
there has to be a way of doing this ... how about

? 25 < getPos this select 2 < 40:trigger1=true

syntax hopelessly wrong, but so you see what I mean?
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detect height
« Reply #2 on: 28 Feb 2003, 18:39:36 »
eh, not exactly... ???

Put IÂ'll try it out to c if it works  ;)

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detect height
« Reply #3 on: 28 Feb 2003, 18:46:59 »
Error: type bool, expected number it said. I dont get this 'getPos this select 2', can u explain that for me and I might solve the problem?
« Last Edit: 28 Feb 2003, 18:47:31 by The real Armstrong »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Detect height
« Reply #4 on: 28 Feb 2003, 18:53:47 »
wat mac said would have worked in theory but ;D

in reality it needs 2 b like dat

Code: [Select]
? (getPos this select 2 < 40) and (getPos this select 2 > 25):trigger1=true

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detect height
« Reply #5 on: 28 Feb 2003, 18:55:44 »
yes, sorry

getPos returns the position of the object, in this case the chopper.     The position is an array - obviously you need an x coordinate, a y coordinate and a z coordinate.      What you need to do is extract the height coordinate.   So what I was really saying

? 25 < chopper height < 40:trigger1=1

I'm a bit vague on how to extract a particular coordinate, I thought that was right.     this select 0 is N-S and this select 1 E-W.   Of the other way around.

Look up getpos in the command ref .... also read the section on arrays.    You'll need to make sure whether you're talking about absolute height or height above the ground at that place.

Hopefully somebody who actually knows about arrays will be along soon ;D


edit:  you see, LCD is here already  :)
« Last Edit: 28 Feb 2003, 18:57:31 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detect height
« Reply #6 on: 28 Feb 2003, 18:57:33 »
IÂ'll check that out. 8)

IÂ'm in a smily-spam mood. ;D Anyone know a cure?

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detect height
« Reply #7 on: 28 Feb 2003, 20:11:19 »
Thx all!

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Detect height
« Reply #8 on: 28 Feb 2003, 20:12:31 »
oh sh!t! I almost forgot....

*Topic Solved And Locked*