Search the Community
Showing results for tags 'dowatch'.
Found 1 result
-
I'm having a couple of snipers (same group) reach their spot and then keep watch over a static position (in the image below represented by the lighthouse). What we noticed is that the more distant the lighthouse, the more untidy the "distracted" snipers' direction in relation to the position (lighthouse) they were supposed to be watching. I've given many go to align the group leader's position but the image was my best. Here are some commands that I've already tried: setDir, getDir, setFormDir. But doWatch and lookAt work better and, of course, because of the purpose, I chose to use doWatch. initServer.sqf (just for testing): waitUntil { !isNull grp1 }; private _sniperPos = [3801.55,4266.83,0]; private _wp = grp1 addWaypoint [_sniperPos, 0]; waitUntil {sleep 0.2; ((leader grp1) distance _sniperPos) < 8 }; grp1 setBehaviourStrong "AWARE"; grp1 setSpeedMode "LIMITED"; { _x setUnitPos "DOWN" } forEach (units grp1); systemChat format ["Before formationDirection '%1'", formationDirection (leader grp1)]; waitUntil {sleep 3; ((leader grp1) distance _sniperPos) < 1 }; { sleep 2; //[_x, (_x getDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getDir LIGHTHOUSE); //[_x, (_x getRelDir LIGHTHOUSE)] remoteExec ["setDir"]; //_x setDir (_x getRelDir LIGHTHOUSE); _x doWatch LIGHTHOUSE; } forEach (units grp1); grp1 setFormation "DIAMOND"; // better than LINE 'cause the spotter doesn't get in the sniper's way most of the time. grp1 setFormDir (getDir (leader grp1)); while { true } do { ["behaviour '%1' / formationDirection '%2' / eyeDirection '%3' / ", behaviour (leader grp1), formationDirection (leader grp1), eyeDirection (leader grp1)] call BIS_fnc_error; sleep 2; }; Demo: https://drive.google.com/file/d/18QGkzuj53y4LwcPvxpYBASMhiQROB76a/view?usp=sharing If you got some more to share, please, keep going!