Hi all.
My first post here.

Originally Posted by
Chemnitzer
And my problem is, that even if the units are commanded to go with these lines:
_unit SetBehaviour "CARELESS"
_unit SetSpeedMode "LIMITED"
_unit domove position _destination
...some of them are still running, [..]. What's wrong here?
As correctly suggested by Pulverizer, you must consider another way to catch the units inside (and still entering) the trigger.
Forget the method {[_x] exec "myscript.sqs"} forEach thisList.
Why?
I'll simulate a typical chain of events in which the above approach fails to satisfy your expectations:
a- mission starts: the trigger status is OFF (no units present by design);
b- some units enter, at the same time, the area of the trigger: the trigger meets the condition and the event "On Activation" is called, so your script too (since the use of "ForEach", you'll have multiple calls);
c- each istance of your script will contain an unit as parameter;
d- one unit is still inside the trigger area: the trigger status is still ACTIVATED;
e- a new unit enter the trigger area: nothing happens;
f- both unit of "d" and "e" points leave the trigger area: the trigger status is now OFF, the condition is no more met and the event "On Deactivation" is called.
Go to "b" point.
The good way for you.
In the field "On Activation" put: trigger_name Exec "myscript.sqs".
Your script will be called once (one istance) and will parse continuosly (loop) the array "List _THIS", where "_THIS" is the reference to the object trigger named "trigger_name".
As soon the array "List _THIS" is empty, the script exits.
A debug sample of the script "myscript.sqs":
Code:
_list_old=[]
#LoopTrig
_list_now=(List _THIS)
@((Count _list_now)!=(Count _list_old))
Player GlobalChat Format ["§ %1",_list_now]
;Parses the array.
_t=(Count _list_now)
;Did all units leave the trigger area?
?_t<1:Player GlobalChat "§ Bye!";Exit
_i=0
#LoopNewUns
_un=(_list_now Select _i)
;Look for new units.
?(_un In _list_old):GoTo "NextNewUns"
;Here your code to apply to the unit "_un".
Player GlobalChat Format ["§ _un=%1 entered",_un]
#NextNewUns
_i=_i+1
?_i<_t:GoTo "LoopNewUns"
;Note the "=+": duplicates the array in memory.
_list_old=+_list_now
GoTo "LoopTrig"
Try it and the report us if the units are seen as you expect.
Regards,
j0e