A couple of points (edit: well it turned out to be more than 2):
The first script I put here was taken from my current mission so it was tailored to that. I have significantly improved the generality of the script. See:
http://www.ofpec.com/editors/resource_view.php?id=788The new script does not need to make any assumption about what triggers are available etc. I submitted it in view of not getting many comments on it here.
You are correct. The scripts will not catch spawned units - I didn't think of that because I never spawn them.
It also will not catch units that move into the trigger area. I did consider having it do that. The reason I didn't was that mostly the script will be used with triggers that cover the map, and as soon as I have used them and got their list I like to do a deleteVehicle on them to cut down on lag.
You are absolutely correct. Moving
#mainloop
to just below
_obj = _this select 0
will enable it to catch all spawned units and all units that later wander into the trigger area. The downside of that is you have to keep the triggers active.
As I said there are many ways this can be implemented. I used a much cruder piece of code in my mission Defensive Strike - don't look at it is ugly - but one nice feature about it was that it worked on a global array of loons, so the mission maker could add new groups during the mission.
What do you think - should I change it to pick up spawned units? It is easy to do. In my new script I would move the start of the loop as discussed and change the script to allow the input of a trigger name rather than a list of loons.
Nice mission. I didn't press 0-0 quickly enough the first time and was joined to a group and so lost the radio. There is a line inthe script
:====================
that should be
;====================
EDIT:
I had a bit of spare time today so did modify the script so that it will capture newly created and respawned units.