Home   Help Search Login Register  

Author Topic: Direction Question  (Read 1305 times)

0 Members and 1 Guest are viewing this topic.

Offline angusjm

  • Contributing Member
  • **
    • Virtual SAS
Direction Question
« on: 09 Oct 2002, 22:03:52 »
How do you check if a unit is pointing a certain direction?

I want a condition for a trigger that will only activate if a unit is facing between certain angles.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Direction Question
« Reply #1 on: 09 Oct 2002, 22:25:42 »
the command you want is

getDir object

returns a number between 0 and 360

eg put in the condition field

175 <= getDir medic1 <= 185

As ever, I direct you to the un+official command refs in the Editors Depot for more info.  :)
Plenty of reviewed ArmA missions for you to play

Offline angusjm

  • Contributing Member
  • **
    • Virtual SAS
Re:Direction Question
« Reply #2 on: 09 Oct 2002, 22:39:15 »
What if you don't know the name of the unit, you want to get the direction of any unit that enters the trigger area?

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Direction Question
« Reply #3 on: 10 Oct 2002, 01:47:09 »
The azimut can be -53 as well as 307, it doesn't matter  :)

...a bit like... nah, nevermind about that  :-[ ;D


*cough* uuum,  :D ya dunno the name of the guy?! May we guess? howsabout... "BOB"  ??? ;D

 j/k, check this out, m8  :o :wow: :o



Trigger (cond. field of horror-codes) :


"Getdir _X >= 230" Count ThisList >0  ;)

This trigger would fire (I believe) if some moron (anyone) was inside the
radius and had an azimut of 230 or above!

An exact direction check would be == instead of >=  :-* But it's unrealistic to hope for that;
imagine a guy looking EXACTLY at 230 degrees  ;D man, you'd have to wait for that trigg to fire!!!

Thus, I'd suggest something like this:

"Getdir _X >= 230" Count ThisList >0 && "Getdir _X <= 290" Count ThisList >0

This way, the trigger will ONLY fire if a d00d walks into it and turns his
fat head in some direction between 230 and 290  :o

(off course, ya can just change those #s to yer delight)


--------------------
Just a sidenote here :  ya wouldn't be working on a "detection" trigger, oy  ???
coz if so, use "knowsabout" - thats more realistic  :) ...oh well, yer call.


« Last Edit: 10 Oct 2002, 01:57:32 by Tomb »

Offline angusjm

  • Contributing Member
  • **
    • Virtual SAS
Re:Direction Question
« Reply #4 on: 10 Oct 2002, 11:46:59 »
That works Great!  :)

The only problem is - what if I want it to go if the guy is pointing between 350 and 10 degrees?  That means that it goes through 0 degrees, so how would I do it?  ???

Pope_Zog

  • Guest
Re:Direction Question
« Reply #5 on: 10 Oct 2002, 12:53:44 »
> what if I want it to go if the guy is pointing between 350 and 10 degrees?

"Getdir _X >= 350" Count ThisList > 0 OR "Getdir _X <= 10" Count ThisList > 0

Pope Zog