About remove Unit Groups for remove leaks...

Status
Not open for further replies.
Level 1
Joined
Jan 11, 2020
Messages
5
Is this Remove all units from UnitGroup
  • Unit Group - Remove all units from b1attackGrup
same as DestroyGroup?
  • Custom script: call DestroyGroup(udg_b1attackGrup)
 
They are not the same. When you remove all units from a group, the empty group is not destroyed.
i use a grup for a boss fight lets call it "AllAttakerGroup". and i have lots of different triggers use that grup for picking random unit, cleared, added and so on during the fight. After boss dead ill remove the group with custom script inside unit died event. so is this a good way or do i need to remove this group ever single trigger and create again for another?
 
You do not have to destroy a group if you re-use it later.
Usually you only have to destroy a group when you create one using something like 'All units owned by player'. In this case, the easiest method to destroy it is to make a custom script before creating the group: set bj_wantDestroyGroup = true.
If you are only adding, removing, and clearing units from a group, you are not creating a new group, so you shouldn't really have to worry about this.
 
Status
Not open for further replies.
Back
Top