I have a system set up where we have the mineral picks spawning around the map (see attached image). The trigger in this image is called by a main loop that happens every day/night switch.
The problem is that for some reason the units in the unit group are not being removed. I have tried 5 or 6 different ways of calling the group or the units in the group to remove them from the map and none of them work.
The variable the spawned minerals are contained in is a global variable that I have set ("Minerals" empty unit group at the start). I know the units are being added to the group because the trigger debugger shows the unit number increasing in the group per spawn.
Does anyone know what I'm doing wrong that is making it so the units don't get removed before new ones spawn? We basically want to wipe the board of the old ones and replace them with the new ones.
Do you want the units to be removed from the unit group, or do you want them to actually disappear ingame?
Removing units from a unit group does only remove them from the unit group data structure, this does not have any noticeable ingame effect. If you want the units to actually disappear ingame, make sure, you used the "remove unit from the game" and not "remove unit from unit group". Shawn's solution should be 100% working.
I tried that originally and it didn't work either... hmm I'll try again I suppose, is there a flaw in how I have the trigger laid out other than that?
Edit: That worked in one of the groups, but for some reason the mineral groups aren't working with that... I think I need to debug a bit more with those.
At least it made some progress, thanks for the help.
I have a system set up where we have the mineral picks spawning around the map (see attached image). The trigger in this image is called by a main loop that happens every day/night switch.
The problem is that for some reason the units in the unit group are not being removed. I have tried 5 or 6 different ways of calling the group or the units in the group to remove them from the map and none of them work.
The variable the spawned minerals are contained in is a global variable that I have set ("Minerals" empty unit group at the start). I know the units are being added to the group because the trigger debugger shows the unit number increasing in the group per spawn.
Does anyone know what I'm doing wrong that is making it so the units don't get removed before new ones spawn? We basically want to wipe the board of the old ones and replace them with the new ones.
Have you tried "Pick each unit in Unit Group" -> "Remove Picked Unit from the Game" ?
@Shawn91210: Go
That was one of the ones I've tried, I can try again if you've had it work for you but I've spent quite a few hours with this now to no avail.
@iHaveReturnd: Go
Do you want the units to be removed from the unit group, or do you want them to actually disappear ingame?
Removing units from a unit group does only remove them from the unit group data structure, this does not have any noticeable ingame effect. If you want the units to actually disappear ingame, make sure, you used the "remove unit from the game" and not "remove unit from unit group". Shawn's solution should be 100% working.
@Kueken531: Go
I tried that originally and it didn't work either... hmm I'll try again I suppose, is there a flaw in how I have the trigger laid out other than that?
Edit: That worked in one of the groups, but for some reason the mineral groups aren't working with that... I think I need to debug a bit more with those.
At least it made some progress, thanks for the help.