Jump to content
Sign in to follow this  
mikey74

Garrison script for combined arms

Recommended Posts

This is what I have:

_Building_Garrison = 
{
_buildings = nearestObjects [_SQ_leader, ["house"], 1000];
_Nearbuilding = [_buildings, _SQ_leader] call CA_near;
If (_SQ_leader distance _Nearbuilding <=21) then 
{


_posArray = _Nearbuilding call _buildingPos;
_coutpos = count _posarray;
//hint format ["%1",_posarray];
sleep 1;
private "_units";
_units = units group _SQ_leader;
_units doMove position _Nearbuilding;
(group _SQ_leader) setSpeedMode "FULL";
{private ["_unit","_pos"]; 
//sleep 3;
_unit = _x;
_pos = _posarray call BIS_fnc_selectRandom;
	_unit doMove _pos;	
	_unit setCombatMode "BLUE";

_unit call {private "_u"; _u = _this; call { waitUntil {unitReady _u;};
 //_unit disableAI "MOVE";
 _unit setCombatMode "RED";
 doStop _unit;
 hint format ["%1 ",_u];};};
	if (count _posarray >=1) then {_posarray = _posarray - [_pos];};
	} forEach _units;
};

};

It works, but the problem I'm running into obviously is that I have to make everyone wait till 1 unit gets into position before the next unit will get into position. I have tried different calls to get the units to all move into position and stop, BUT lol to no avail. Does anyone have an idea of what I may can do. Yes I've done different searches, and yes I know I can use already made scripts. I wont learn anything that way. ;) Any help would be appreciated. :)

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  

×