I noticed that once of the filters for searching a unit group is "dead". I'm assuming that means that dead units can be in a unit group. I'm also assuming that once a unit is erased from data, it is removed from the unit group, and only units that have a "death time" still active are counted by that requirement.
However, does anyone know for sure? Does the unit group know if a unit has been erased from memory? The reason I ask is I use a "number of units in unit group" statement, and I would like to add units with a death time to the group. That would require unchecking the "dead" filter.
So yeah, will that return every single unit that has even been in the unit group but hasn't been removed? Probably a stupid question, but I would rather not run 100 tests if the answer is already known.
well yeah, the units are still in the unit group if they are dead or not.. just add a trigger..
unit dies
if triggering unit = marine
remove triggering unit from unit group
(well, i think that adding millions of units into a unit group can make more lagg to the game.. im not 100 % sure, but i always adds a trigger to remove them from the group)
As a general rule from the Old Warcraft 3 Editor (memory leaks were huge back then), I always remove the unit from the unit group then kill the unit. Sometimes I'll clear a unit group with a periodic trigger such as "Pick every unit and unit Group and remove unit from unit group), mainly because I am afraid of memory leaks, which I believe you are as well.
// Many native types represent "complex" objects (i.e. larger than 4 bytes). The script language// automatically keeps track of these objects and deletes them from memory when they are no longer// used (that is, when nothing in the script references them any longer). The types which benefit// from automatic deletion are://// abilcmd, bank, camerainfo, marker, order, playergroup, point,// region, soundlink, string, text, timer, transmissionsource, unitfilter, unitgroup, unitref,// waveinfo, wavetarget//// Other object types must be explicitly destroyed with the appropriate native function when you// are done using them.
In general, dead units are not removed from a unit group. However, units are removed from a unit group, when they are removed from the game; which is almost equivalent in SC2.
By default, units get removed from the game, as soon as they die. So in most cases, they get removed from the unit group as soon as they die as well.
The only exceptions are units with a Death Time > 0; they will be saved in the unit group, until the death time expires or they are removed from the group or from the game manually.
So wait, which object types must be explicitly destroyed? Is there a list somewhere for easy reference?
the "other" :D type "destroy" in action selection to see. If you want to go deeper open Window > Console and type browse, then theres galaxy natives file somewhere, some stuff its not present in GUI. (i recommend coping this natives file to some txt file because searching inside editor takes ages)
I noticed that once of the filters for searching a unit group is "dead". I'm assuming that means that dead units can be in a unit group. I'm also assuming that once a unit is erased from data, it is removed from the unit group, and only units that have a "death time" still active are counted by that requirement.
However, does anyone know for sure? Does the unit group know if a unit has been erased from memory? The reason I ask is I use a "number of units in unit group" statement, and I would like to add units with a death time to the group. That would require unchecking the "dead" filter.
So yeah, will that return every single unit that has even been in the unit group but hasn't been removed? Probably a stupid question, but I would rather not run 100 tests if the answer is already known.
Great to be back and part of the community again!
well yeah, the units are still in the unit group if they are dead or not.. just add a trigger..
unit dies
if triggering unit = marine
remove triggering unit from unit group
(well, i think that adding millions of units into a unit group can make more lagg to the game.. im not 100 % sure, but i always adds a trigger to remove them from the group)
@okmaster: Go
I thought they were removed. But now that I think of it. It does say
Which implies a dead unit can be in the group. Maybe units with a death time more than 0 (like heroes) are "saved".
@zeldarules28: Go
As a general rule from the Old Warcraft 3 Editor (memory leaks were huge back then), I always remove the unit from the unit group then kill the unit. Sometimes I'll clear a unit group with a periodic trigger such as "Pick every unit and unit Group and remove unit from unit group), mainly because I am afraid of memory leaks, which I believe you are as well.
@EdwardSolomon: Go
From galaxy natives:
In general, dead units are not removed from a unit group. However, units are removed from a unit group, when they are removed from the game; which is almost equivalent in SC2.
By default, units get removed from the game, as soon as they die. So in most cases, they get removed from the unit group as soon as they die as well.
The only exceptions are units with a Death Time > 0; they will be saved in the unit group, until the death time expires or they are removed from the group or from the game manually.
So wait, which object types must be explicitly destroyed? Is there a list somewhere for easy reference?
the "other" :D
type "destroy" in action selection to see. If you want to go deeper open Window > Console and type browse, then theres galaxy natives file somewhere, some stuff its not present in GUI.
(i recommend coping this natives file to some txt file because searching inside editor takes ages)