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

[General] Periodic timer sudenly breaks

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2014
Messages
24
Hello,

I hope someone here can help with me a really strange behaviour.

I have theses 2 simple triggers :

TRIGGER 1 - RENEW CASTING
[EVENT]
A Unit Start the effect of an ability

[CONDITIONS]
Ability being cast equal to "Renew"

[ACTIONS]
Add - target unit of ability being cast to "renew_group"

---------------------------------------------------------------------------------

TRIGGER 2 - RENEW HEALING
[EVENT]
Every 1.00 second of game time

[ACTIONS]
Pick every unit in "renew_group" and do
if Picked unit has buff "Renew" equal TRUE then
set life of picked unit to life of picked unit +30
else
remove unit from renew_group


For a strange reason, sometimes the second trigger sudenly doesn't workanymore.

I added debugging texts to be sure, that only the second one fails.

It fails after a random amount of time, usually after 3 - 15 minutes (spell casted between 4 and 18 times).

Once it has failed, it doesn't work again for the rest of the game (even if spell is casted again 10 times), the unit is always added to group (proven by my debugging message), but then the periodic part doesn't do anything (but it does show a message at the start of the periocdic trigger, so this is the part with the "Pick and If" that sudenly fails).

It can also fail while the spell is on going (the buff lasts 15 seconds), it sudenly stops.

Does this mean I have a leak somewhere ?

Any ideas ?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Somewhere you are destroying renew_group with one of these two lines:
  • Custom script: call DestroyGroup(udg_renew_group)
  • --------- or ---------
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in renew_group and do...
I think the second is more likely the culprit, because that first line could come from any trigger right before the periodic is run.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Any time that flag is set to true, the next instance of a group being used by GUI will be automatically destroyed. Usually it's done so you don't have to save the group in a variable and then manually clear it. Can you post the bit of code with that line in it that was causing the problem? It's possible something there was written incorrectly, or you might now inadvertently have a group leak.
 
Level 3
Joined
Sep 9, 2014
Messages
24
In fact I always clear the groups leak with custom script, this line was from a snippet I coppied, and it was non sense since I removed the "group" part of it, but left that line.

That line was occuring everytime the event "A unit is attacked" was triggering, that's what made it totally random.


Edit : Oh ! I understood what you said, just for personnal knowledge are you sure the flag is set for the next instance or the previous one ?
 
Last edited:
Status
Not open for further replies.
Top