Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok so this is mind boggling to me. Every time I've used something similiar before it works. I added messages to be displayed before everything happened to see where it would, and it never got past the wait.

     Unit - A unit Begins casting an ability
     (Ability being cast) Equal to Berserking Power [E]
     Unit Group - Add(Triggering unit) to heroSpellUG[(Player number of (Owner of (Triggering unit)))]
     -Unit Group - Pick every unit in heroSpellUG[(Player number of (Owner of (Triggering unit)))]
           Unit - Add Berserking Power Damage to (Picked Unit)
           Unit - Set level of Berserking Power Damage for (Picked Unit) to (Level of Berserking Power [E] for (Picked Unit))
           Wait (5.00 + (Real((Level of Berserking Power [E] for (Picked Unit))))) game-time seconds
           Unit - Remove Berserking Power Damage from (Picked Unit)
           Unit Group - Remove (Picked Unit) from heroSpellUG[(Player number of (Owner of (Picked Unit)))]

So I guess my question is, why is the Wait not completing. I had it display what the time to wait was and it said 6 seconds at level one. Any help would be appreciated.

share|improve this question

migrated from May 21 '11 at 15:51

This question came from our site for professional and enthusiast programmers.

don't have any idea; you can ask icefrog guess he can help! – Ali.S May 21 '11 at 19:04

Umm, i have a few things to mention here ...

First you're using GUI which is in WC3 really weak and not useful, try to learn Jass and vJass they're more powerful

Second, there are plenty of forums made for Wc3 the best i know is a wc3c. They can help you better than we can do.

Third, it seems that you are trying to do something like a berserk skill, you should try to create a dummy unit add it an ability with the buff and the duration you want and let it cast the ability on all units u want to have the buff.

Forth, waits in picks are stupid, because they will go like this: First unit gets buffed - 6 seconds wait - debuff - Second unit gets buffed - 6 seconds wait - etc. I guess you don't want it to happen like this

share|improve this answer

Not sure what you're trying to accomplish, but that doesn't look right at all:

  • You are calling a wait inside the loop, meaning if there are two units in the heroSpellUG group, the second unit will not get the Berserking Power Damage attribute until after Berserking Power Damage has been added and removed from the first unit (~ 6 seconds later)
  • Because this is being called asynchronously (every time a unit casts Berserking Power), and you are adding and removing from a unit-group inside a loop, you are almost certainly opening yourself up to race conditions that occur when two units cast Berserking Power at the same time.

It's been a while since I've done any WC3 scripting, but what you probably want to do is add the ability to only that unit, then create a timer which takes away the ability when it expires.

share|improve this answer

Try it with just one unit triggering the effect. When multiple units trigger the effect the they will only receive your buff sequentially. Also unit groups and picks will create memory leaks, try to avoid them. Also try it with a static time, and add a message at the very end of the script to debug it.

share|improve this answer

What do you mean by "not completing"?
Does it never end?
Does it never happen?

You might wanna ask on where your chances to get an answer are 100000 times greater than on

Edit: Seshiro said

Forth, waits in picks are stupid, because they will go like this: First unit gets buffed - 6 seconds wait - debuff - Second unit gets buffed - 6 seconds wait - etc. I guess you don't want it to happen like this

This is true, but also during the wait the trigger may run again, so the first unit in the group (UnitGroups are queues) will get the effect lots of times and the others will get it slowly...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.