• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit Group variables sometimes getting destroyed

I ocassionally encounter several inconsistent bugs in my map that as far as I can tell come from unit group variables getting accidentally deleted so they can no longer be used, but the thing is I don't have any triggers that are supposed to delete them, so I'm at a loss for why it is happening. It's pretty much exclusively when playing the map online, I can't remember ever encountering it in testing.

My best bet for how it happens is that set bj_wantDestroyGroup = true sometimes "leaks" through the group used immediately after that it's supposed to destroy and instead destroys whichever group is used next (since that's the only code I use that can delete groups except GUI Unit Event), can anybody confirm or deconfirm if such a thing is possible? Or know of any other issues that can delete group variables?

In testing it doesn't seem to be the case, even if the group is empty it won't pass through to the next.
 
My best bet for how it happens is that set bj_wantDestroyGroup = true sometimes "leaks" through the group used immediately after that it's supposed to destroy and instead destroys whichever group is used next (since that's the only code I use that can delete groups except GUI Unit Event), can anybody confirm or deconfirm if such a thing is possible? Or know of any other issues that can delete group variables?
Yah, this is possible and is the most likely source of your problem.

Explanation from @Insanity_AI:

To elaborate:any trigger in your map does this action without calling a unit group enumeration action of any kind, which then causes that setting to overflow into any group enum action (or even a condition in this case) that causes the group to get destroyed at the end

something like:

set bj_wantDestroyGroup = true
if (something) then
call ForGroup(...)
endif
end of function

bj_wantDestroyGroup stays true because ForGroup didn't execute in this case if something was false
 
Yah, this is possible and is the most likely source of your problem.

Explanation from @Insanity_AI:
Thanks I did have one of those which I've fixed but not sure if it was the main issue since it was an if statement that was only ever false under extremely specific circumstances. Guess I'll see if the issues persists
 
Back
Top