Home   Help Search Login Register  

Author Topic: Angles  (Read 895 times)

0 Members and 1 Guest are viewing this topic.

Offline six6six

  • Members
  • *
Angles
« on: 31 Jul 2008, 16:29:48 »
I have 2 problems regarding the same script.

Ive downloaded the fuction "AngleFacingDiff.sqf" and Im not entirely sure how to use it. I want to tell whether a unit in this case _guy is looking at object _thing. So I have called it with the line [_guy,_thing] call AngleFacing after loading it before the mission as AngleFacing.
Code: [Select]
]
_ang= [_guy,_thing] call AngleFacing

if (_ang < 10) then (goto "next1")
if (_ang >350) then (goto "start")
Im using this code to see if he is looking within 10 degrees either side of the object. Are there any problems?

I ask, as when I put in
Code: [Select]
hint format ["Angle = %1", _ang]I get a load of random numbers and letters which show up when you have screwed up the numbers. Please help.

Offline dr. seltsam

  • Members
  • *
Re: Angles
« Reply #1 on: 31 Jul 2008, 21:37:43 »
Make sure your function is introduced to the mission before using it. Best place is the init.sqs:

Code: [Select]

AngleFacing=preprocessFile "AngleFacingDiff.sqf"


:)

Offline six6six

  • Members
  • *
Re: Angles
« Reply #2 on: 31 Jul 2008, 22:24:31 »
Ive done that already, and i did mention that in the OP.