Thanks for the answer.
This is indeed what I'd like. But where do I put the above code? The init.sqf file would be insufficient since it is run after the object initialization fields. So first the game would add the objects to an array that does not exist and afterwards it would create an empty array.
Just to clarify my problem perhaps...
I'd like to create a vehicle, an ammobox, a building, 3 OPFOR units and 4 BLUEFOR units. A trigger should activate when they're all dead and another trigger should activate when they are 50m from a certain flag. If the mission seems imbalanced I would like to be able to add a fourth OPFOR unit that is taken into account. Or a fifth. Or a second ammobox... I also want to be able to add a third trigger and define that 2 of the OPFOR units are eligible to trigger it as well as the vehicle.
What I would like to avoid is adding unique names of objects in the editor AND in the initialization blocks AND in the trigger condition blocks AND in script files. Just add one unit in the editor and put 'trigger1Units = trigger1Units + [this]' or 'trigger1Units = trigger1Units + [this]; trigger2Units = trigger2Units + [this]' to the initialization field, depending on which trigger(s) it should be linked to.
I hope someone can help me with this problem. :)
---------- Post added at 09:57 ---------- Previous post was at 09:49 ----------
Thanks for the reply! This is almost what I want. :)
If I want to add multiple tags to one unit though:
if (isNil "tag1Units") then {tag1Units = []};
tag1Units set [count tag1Units, this];
if (isNil "tag1Units") then {tag1Units = []};
tag3Units set [count tag3Units, this];
if (isNil "tag1Units") then {tag1Units = []};
tag7Units set [count tag7Units, this];
The above seems less clear than the following:
tag1Units set [count tag1Units, this];
tag3Units set [count tag3Units, this];
tag7Units set [count tag7Units, this];
The different tagXUnits would first be declared in a script file preferably.
The problem is not so much that that it's impossible in the editor. It is definitely possible but I would love it to be very easily doable inside the editor once the underlying code has been written. Maybe I should just settle for the normal-people-way. :)