oh ok so,
north is 0, then east would be 90? south 180? and west, i think either 270, or 240? right?
thanks abunch trigg, and thanks everybody else too
so, then the finished product would be this? Right??
; AI Respawn Script by angusjm
; 5th March 2004
;
; Call this script using the following syntax:
;
; [1,unit to converge around,array of groups,units per group,type of unit,skill of units,radius around unit to converge around,body disapear on or off (1 on, 0 off)]
;
; The AI will be created of a random one of the type specified and will head towards the unit to converge around
;
;Example [1,player,[east1,east2],12,["SoldierEB","SoldierEMG"],0.1,50,1] exec "ajmrespawn.sqs"
_wtd = _this select 0
_aUnit = _this select 1
? _wtd == 0: goto "missemall"
_agroups = _this select 2
_apg = _this select 3
_askill = _this select 5
_aradius = _this select 6
_thon = _this select 7
_list=_this select 4;
_ntotal=count _list;
_c = 0
#loop
#gloop
_rg = count units (_agroups select _c)
? _rg >= _apg : goto "misscreate"
_rg = _apg - _rg
#iloop
_rnum = 0
_d1 = getpos _aunit select 0
_d2 = getpos _aunit select 1
_d3 = 0
_random=random(_ntotal);
_result=_random - ((_random) mod (1));
if (_result==_ntotal) then {_result=_result-1};
_utype = (_list select _result);
_d1 = _d1 + _aradius * sin(_rnum)
_d2 = _d2 + _aradius * cos(_rnum)
_utype createunit [[_d1,_d2,_d3],_agroups select _c,"",_askill,"PRIVATE"]
? _thon == 1 : {_x addeventhandler [{killed},{[0,_this] exec {AJMRespawn.sqs}}]} foreach units (_agroups select _c)
_agroups select _c move getpos _aunit
leader (_agroups select _c) move getpos _aunit
_rg = _rg - 1
? _rg == 0 : goto "misscreate"
goto "iloop"
#misscreate
_c = _c + 1
? _c == count _agroups : _c = 0; goto "eloop"
goto "gloop"
#eloop
~0.5
goto "loop"
#missemall
~30
deletevehicle (_aunit select 0)
#alll
exit
OFPEC Forums | Powered by YaBB SE