Announcement

Collapse
No announcement yet.

Scan Horizon

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scan Horizon

    I wanted some units to scan the horizon but in a randomized and more natural way. I found the AI to keep reverting to watching the direction as I'd placed them in the editor. "this setDir xxx" only had a momentary effect so I started using doWatch and commandWatch.

    Remember to place some "game logic" of type "object" around and name them "dirnorth", "direast", "dirsouthwest", ect...
    They could be invisible H pads or any other object you like that won't move!

    Code:
    //scanHorizon.sqf by Unkl for TacticalGamer.com
    //useage nul = [<unit to order to watch horizon>] execVM "TG\scanHorizon.sqf";
    //place 8 game logics around the AO and name them as _watchDirections!
    
    _unit = _this select 0;
    _watchDirections = [dirnorth,dirnortheast,direast,dirsoutheast,dirsouth,dirsouthwest,dirwest,dirnorthwest];
    _nextIndex = 0; //set default
    _sleepTime = 30; //set default
    
    while {alive _unit} do
    {
    	_nextIndex = floor random 8;
    	_unit doWatch (_watchDirections select _nextIndex);
    	_sleepTime = (floor random 30) + 15;
    	sleep _sleepTime;
    };
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member
    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
    "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

Connect

Collapse

TeamSpeak 3 Server

Collapse

Advertisement

Collapse

Twitter Feed

Collapse

Working...
X