• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Unit Group Arrays

Status
Not open for further replies.
Level 2
Joined
Jul 8, 2017
Messages
17
So when we're clearing up unit groups, we clear them using the DestroyGroup(udg_...) script, which as far as I understand, releases the group from its referencing variable. For unit group that has array data, does this only clear the data with the specified array value (1, 2, etc.), or does it clear the entire unit group (TempGroup)?
 
Group[0] is its own unit group
Group[1] is its own unit group
Group[2] is its own unit group
..

so each index has it's own entire unit group. When running "call DestroyGroup(udg_Group[0])", other groups won't be destroyed.

Also, clearing and destroying a group isn't quite the same.
"destroying" a group means the group doesn't exist anymore to work with at all.
"clearing" does only mean to remove all units from group. Technically, the group still exists and you can work with it, like adding new units, or so. It has just been emptied.
 
Level 2
Joined
Jul 8, 2017
Messages
17
So, say if I had an MUI spell that uses dynamic indexing then, would I have to still run the custom script, since I'm going to reference it to a new variable? Or should I just remove all the units from the specific unit group?
 
Level 12
Joined
Feb 5, 2018
Messages
521
So, say if I had an MUI spell that uses dynamic indexing then, would I have to still run the custom script, since I'm going to reference it to a new variable? Or should I just remove all the units from the specific unit group?

Yes. You need to destroy the group to avoid leaks.
 
Status
Not open for further replies.
Top