Home   Help Search Login Register  

Author Topic: Looking at objects  (Read 813 times)

0 Members and 1 Guest are viewing this topic.

seanver

  • Guest
Looking at objects
« on: 29 Oct 2002, 21:50:30 »
Is there any way to know if a unit is looking at an object? Or at a direction, such as a range between 270 and 300 degrees, for example.

 I'll explain what I want to do. I want the player to be able to execute an action if he's looking at an object. But he must be looking at it, so only a trigger with a small size is not enough. I need him to be seeing it, and besides (I know how to do that) he must be close enough. Ideas? Suggestions? An example mission?  ::)

Gameer_77

  • Guest
Re:Looking at objects
« Reply #1 on: 29 Oct 2002, 22:19:59 »
? getdir player > 270 and getdir player <300 and player distance objname < 10:[] exec "something.sqs"

 :-*

 8)PEACE

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:Looking at objects
« Reply #2 on: 29 Oct 2002, 22:20:33 »
I'm not sure how to tell if someone is looking at something, but you can tell what direction the person is looking.  Use the getDir command.

_dir = getDir player1

? (_dir > 270 and _dir < 300) : Do Something

[edit]Gameer_77 beat me to it. :)[/edit]
« Last Edit: 29 Oct 2002, 22:22:32 by Ranger »
Ranger

seanver

  • Guest
Re:Looking at objects
« Reply #3 on: 29 Oct 2002, 22:26:23 »
Thanks! I think that's enough, since the player will be in a room, the object's direction will be the same for the player at any position.