making up some code as i go...i'm not asserting it's accuracy. in fact, i started doing this an extremely hard way (comparing 2 different vectors)
EDIT: this script does not work.
if !(local server) exitWith {};
_idiotPos = getPos idiot;
_targetPos = getPos targ;
//we have to loop this because the waitUntil command is too slow
for [{},{true},{true}] do
{
//pick up x and y offsets to calc the angle
_x = ( (_targetPos select 0) - (_idiotPos select 0) );
_y = ( (_targetPos select 1) - (_idiotPos select 1) );
_z = ( (_targetPos select 2) - (_idiotPos select 2) );
//direction from x-axis to the target
_theta = atan (_x/_y);
if (_x<0) then
{
if (_y<0) then
{
_theta = _theta+180;
}
else
{
_theta = _theta+360;
};
}
else
{
if (_y<0) then
{
_theta = _theta+180;
};
};
//ok i'm pretty sure the above is correct....gives us a 0-360 angle from the north point
//grab the direction vector of the idiot's binoculars
_vec = idiot weaponDirection "Binocular";
//now we have to do it all over again on the direction vector.
//i chose to recycle my variables here =)
_x = _vec select 0;
_y = _vec select 1;
_dir = atan (_x/_y);
if (_x<0) then
{
if (_y<0) then
{
_dir = _dir+180;
}
else
{
_dir = _dir+360;
};
}
else
{
if (_y<0) then
{
_dir = _dir+180;
};
};
if (round (_dir) == round(_theta)) then
{
_idiot disableAI "ANIM";
};
sleep 0.25;
};
try that!....i just wrote it hehe
EDIT: oh and if you want the guy to be playable again, make sure you idiot enableAI "ANIM";
EDIT: realized that the <tt></tt> tags don't work on this board. otherwise it would have been in a monospace font...
EDIT: ok now this is driving me crazy.....was looking over my code again and i forgot to change weaponDirection from a vector to an angle...one possible problem i can think of is if he is looking at teh guy before the binoculars are against his face. so this might have all been in vain. what really needs to be figured out is how to lock onto a specific animation state...that would be teh best say to do it, if it were possible.