Title pretty much says it..
I'm trying to set up so that when a unit enters region001 he is added to UnitGroup001 (the group in that region)
I've done multiple things like when the unit enters the region, kill triggering unit, and it worked..
but I can't figure out how to add a unit to an existing Unit Group
I tested by setting up so that Units in UnitGroup001 would die when entering region001.
I set up a separate region (we'll call it region002) that would add units to UnitGroup001 upon entering the region.
Existing units in UnitGroup001 would die when walking into region001, but not the others when I moved them first into region002 to add them to the UnitGroup001, and then into region001, which tells me they weren't added to the Unit group like I intended.
Sorry if this is confusing..
It's a bit late.
Ask questions if needed and I'll clarify in the morning.
Thanks for any assistance in advanced!
To expand what SouLCarveRR is talking about with the variable, and what I was asking for the scope, is that your variable scope has to be within the bounds of your triggers.
So, easiest way to accomplish this is make a folder, make a variable type of Unit Group, and toss your triggers in there that involves that variable. Here's a working example of what you might want to use.
There's 3 triggers and 1 variable.
Unit Group Kill, a variable of type Unit Group, set to default empty.
Set Unit Group Kill, adds the triggering unit to the Unit Group Kill.
Kill Unit Group Kill, kills the triggering unit if and only if the triggering unit is in Unit Group Kill, else it scales it to 200%.
Remove Unit Group Kill, removes the triggering unit from Unit Group Kill.
Here are some example pictures of what I'm trying to accomplish. Fairly detailed.
I'm very new to this so please be patient with me..
But here's what I have to give a better idea of what I need to do.
Title pretty much says it.. I'm trying to set up so that when a unit enters region001 he is added to UnitGroup001 (the group in that region) I've done multiple things like when the unit enters the region, kill triggering unit, and it worked.. but I can't figure out how to add a unit to an existing Unit Group
I tested by setting up so that Units in UnitGroup001 would die when entering region001. I set up a separate region (we'll call it region002) that would add units to UnitGroup001 upon entering the region. Existing units in UnitGroup001 would die when walking into region001, but not the others when I moved them first into region002 to add them to the UnitGroup001, and then into region001, which tells me they weren't added to the Unit group like I intended.
Sorry if this is confusing.. It's a bit late. Ask questions if needed and I'll clarify in the morning. Thanks for any assistance in advanced!
Where is this UnitGroup001 being created and what is its scope?
Add triggering unit to unit group.... if it doesnt work.. your doing something wrong
Your Unit Group variable would need to be global as well if your using multiple triggers...
try using text commands
To expand what SouLCarveRR is talking about with the variable, and what I was asking for the scope, is that your variable scope has to be within the bounds of your triggers.
So, easiest way to accomplish this is make a folder, make a variable type of Unit Group, and toss your triggers in there that involves that variable. Here's a working example of what you might want to use.
There's 3 triggers and 1 variable.
Unit Group Kill, a variable of type Unit Group, set to default empty.
Set Unit Group Kill, adds the triggering unit to the Unit Group Kill.
Kill Unit Group Kill, kills the triggering unit if and only if the triggering unit is in Unit Group Kill, else it scales it to 200%.
Remove Unit Group Kill, removes the triggering unit from Unit Group Kill.
Here are some example pictures of what I'm trying to accomplish. Fairly detailed. I'm very new to this so please be patient with me.. But here's what I have to give a better idea of what I need to do.