Jump to content
Sign in to follow this  
plugger

Simple Scanning

Recommended Posts

G'day,

I have several AI snipers in a mission manning rooftops.

Because of the variable entry points of the player controlled units I end up with situations where the snipers are looking in the wrong direction.

How do I get the snipers to 'scan around', eg. continuously search all around ?

Thanks in advance.

Cheers,

Plugger

Share this post


Link to post
Share on other sites

I use this, mostly for search lights or mounted MC guns but it will work for simple units.

// Obj is the units name who will  search;
// Deg is the area that the unit will search  0 - 359;
// null=[obj,deg] execVM "movegunner.sqf"
// By F2kSel


//if (!isServer) exitWith {};

_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;
};

Share this post


Link to post
Share on other sites

G'day,

Does the job!

Much appreciated.

Thanks,

Plugger

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×