• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit Group Leak question

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
You only need to clear it if you create it. If it is created in an if statement, destroy it in the if statement. Destroying a destroyed group may also cause a crash, but I'm not sure.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I think so. What does the trigger look like? Is there something like (Units in region (myRegion))? That creates a group, so you would need to clear that leak.
 
Level 12
Joined
May 22, 2015
Messages
1,051
No problem :)

For most cases, you can use the same group variable. Just call it tempGroup or something. It's not so bad once you start using the variable by default. It makes cleaner code as well.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
When you do a ForGroup action or "Pick every units in <unitgroup> and do action(s)" then it will also destroy the group if bj_wantDestroyGroup (a global boolean variable) is set to true.

This works with both variables and direct groups but this custom script cannot be placed in conditions as custom scripts are not allowed there.

This only works with the Blizzard.j ForGroupBJ function and not for ForGroup from Common.j (for people who understood what I just said.)
 
Status
Not open for further replies.
Top