• 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.

What exactly does this do?

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
  • Custom script: set bj_wantDestroyGroup = true
I'm confused because we are told to use this to get rid of Unit Group leaks, but I get mixed results with it, in some of my triggers..I GUESS it does its job, the triggers works properly after multiple casts of the triggering spell. However, in other triggers this pretty much makes it so the Unit Group actions either do not work, or work the first time and never again. I can post a trigger if that would be helpful but I think I'm more just trying to understand what this statement precisely does.
 
That is to be used if u create the unit group in the pick every unit action.
If u do set group = whatever then u don't use this one u have to destroy the group after.
It basically sets a Boolean that tells the BJ action that creates the group to destroy it when the group loop is over.
I explain a little more on this in my tutorial. Things a GUI user should know in my sig
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
So if it destroys the group right after it (after doing its necessary actions) can this group no longer be referenced if the trigger is to reran? Because some of Unit Groups are doing the proper actions the first time they are called, but the second time (I presume after the group has "been destroyed") there is a problem.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
So if it destroys the group right after it (after doing its necessary actions) can this group no longer be referenced if the trigger is to reran? Because some of Unit Groups are doing the proper actions the first time they are called, but the second time (I presume after the group has "been destroyed") there is a problem.

Well, if you will still reause a trigger, I suggest dont destroy a group mostly if it will be used over and over again in the trigger and also the trigger can be used or by any means recycled.

Destroy a group when only the trigger will not be used anymore.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Well if Unit Group will pretty much never be destroyed until the game ends then, in which case, how can I limit the "leakage" of this unit group? If destroying is not the proper method?
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Well if Unit Group will pretty much never be destroyed until the game ends then, in which case, how can I limit the "leakage" of this unit group? If destroying is not the proper method?

Well, what I mean is YOU CAN REMOVE UNIT groups, only if you find no use for it anymore in other situations or will be only used once.

But in the other hand, if the unit will be used many times and can be recycled, I suggest dont remove the group

And there no leaks in unit group unless there is, in your trigger.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
For set bj_wantDestroyGroup = true is when you want to destroy Unit Group that is not set via variable.
For this one, the default setting of the boolean is equal to false, which means the Unit Group function never clean the leak caused by this function.
The function checks the boolean for it to be destroyed or not: true = destroy | false = does not destroy
So by setting it to true, it will destroy the Unit Group once after it's been used.

When you want to destroy Unit Group that is from a variable, do this: call DestroyGroup(udg_variableName)
 
Last edited:
Status
Not open for further replies.
Top