I have a problem with script i'm working on.
Idea is:
Some single soldiers, whose names is stored in array survivors1 are moving to position of trigger (name trigger1, radius 60, activation by west, present west, [evac1, trigger1] exec "survivors.sqs). When soldier "hits" the trigger, it has to go prone, join group evac1, and wait. And only soldiers "inside" trigger has to be proned, other in array survivors1 should stay running. When all soldiers are "inside" trigger, leader of group should say they r waiting in position. I have wrote script like that:
;surviwors.sqs
_group = _this select 0
_trig = _this select 1
#loop
_tmp = list _trig - survivors1
_ar = list _trig - _tmp
_l = count _ar
? _l == 0 : exit
_i = _l - 1
_ar select _i setunitpos "down"
[_ar select _i] join _group
_group move [(getpos _trig select 0) + 15, (getpos _trig select 1) + 15]
? (count units _group == "alive _x" count survivors1) : _point == "ALPHA" ; rescue1 = true; goto "sa"
~.5
goto "loop"
#sa
leader _group sideChat "Survivors are waiting in Evac point " + _point
_group setformation "column"
exit
And sometimes it works, sometimes not. I really do not know why..
I mean sometimes soldiers r added to group, sometimes not, sometimes they go prone sometimes not. Group is "declared" by putting soldier with "evac1 = group this; deletevehicle this" in init field.
I was trying without loop, just changing type of trigger to "revealed by west", but it always worked only for the first soldier.
Maybe someone can find easier way?