Function mando_angles.sqf v1.0
Returns the angle between obj1 and obj2, the degrees that obj1 needs to turn to have obj2 centered horizontally and checks whether obj2 is inside field of view of obj1
Negative means turning left, positive means turning right
The returned value is in the form [angle, angle to turn, inside FOV true/false]
Load and compile the function first in your init.sqs or init.sqf
mando_angles = compile (preprocessFileLineNumbers "mando_angles.sqf");
Then to call it:
_angles = [firstobject, secondobject] call mando_angles;
_angles select 0 = angle between firstobject and secondobject
_angles select 1 = angle that firstobject needs to turn to have secondobject centered horizontally
_angles select 2 = true if secondobject is inside field of view of firstobject