afp 1 Posted August 17, 2009 The question also reffers to mounted static weapons like the machine guns on UAZs or tank turrets, for example. I want to change their direction like every 10 second. Is there a way to do this with waypoints / triggers / timeouts or with a scripted loop only? ---------- Post added at 07:53 AM ---------- Previous post was at 06:07 AM ---------- I the meantime I found out that Destroy waypoint do a good job for statics. Share this post Link to post Share on other sites
f2k sel 164 Posted August 17, 2009 (edited) unit dowatch unit2; unit dotarget unit2; one of those should work but I don't like them, you would need a couple and switch them to one or the other. I use setformdir as it leaves the gunner free to override the command a little easier. unit setformdir 90 will turn the gun or search light. unit setformdir (random 360) should turn it to a random direction. You can do it with triggers but you need a true repeating trigger. I just use script as I hate really static gunners or search lights. To use it place your gunner in the direction you want and place this in it's init line null=[this,120] execVM "movegunner.sqf"; save the scripts as movegunner.sqf It basically scans left and right at random so many degrees, the no of degrees it can search can be 0-360, it will turn to engage outside that angle if it hears or sees an enemy It will work for units on a vehicle but I'm not sure about the degree limit. For a searchlight you may want to increase the delay between scans sleep (random 12)+6; works better. // Obj is the unit searching 0-359; // Deg is the area that the unit will search; // null=[obj,deg] execVM "movegunner.sqf"; _unit = _this select 0; _deg = _this select 1; _face = getdir _unit; _gman = (gunner (vehicle _unit)); while {(alive _gman) && (alive _unit)} do { _gman setformdir _face+((random -(_deg)+(_deg/2))); sleep (random 6)+2; }; Edited August 17, 2009 by F2k Sel Share this post Link to post Share on other sites
afp 1 Posted August 17, 2009 (edited) Thank you, just great. I was already playing around with dowatch, you cant also set them to turn to markers (unit dowatch markerPos "marker1" in activation of two GETIN timeout waypoints and a CYCLE one). But setformdir looks much better but I cant make it work in waypoint activation for now...(gunner (vehicle DH1)) setformdir random 360; hint "1"; PS also seems to work with "commandWatch" Edited August 17, 2009 by afp Share this post Link to post Share on other sites
afp 1 Posted August 21, 2009 Now I'm trying to make a guy with binocular to scan horisont, it looks like the direction he watches is very narrow and cant make him rotate while with binoculars... any idea? Or how to create some kind of "early warning" units.. Share this post Link to post Share on other sites
Deathcon5 10 Posted January 18, 2010 F2k I modded your script for use with searchlights and added direction and timing options from the init line. Posted here: http://forums.bistudio.com/showthread.php?p=1547257#post1547257 Share this post Link to post Share on other sites