• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,657
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