Why Can't You Use Waits

Squirel

New Member
Reaction score
13
The problem with waits in GUI is that if you have a global variable it might be rewritten during the wait, messing with your MUI. If you code in JASS and use mostly locals, waits shouldn't be a problem.
 

Teach101

New Member
Reaction score
4
For more precise information, tell us how you've learned to code MUI, and we'll tell you whether or not it can support waits and why. :p

Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MUI Greater than or equal to (>=) 8000
Then - Actions
Set MUI = 0
Else - Actions
Set MUI = (MUI + 1)

To carry the MUI to a different trigger I would add a unit to a unit group and set his custom value, then recall the custom value.
 

Squirel

New Member
Reaction score
13
Going through a massive array like that is technically not MUI. With a system like that, waits will be a huge problem because the global you are using to denote the position in the array is always changing... Two words: Learn JASS.
 

Teach101

New Member
Reaction score
4
Going through a massive array like that is technically not MUI. With a system like that, waits will be a huge problem because the global you are using to denote the position in the array is always changing... Two words: Learn JASS.

It technically is mui... and jass.. na to boring!
 

jwallstone

New Member
Reaction score
33
The proper way to use waits in this case if you want to be safe would require:

1. Store all the variables you'll need at the beginning to local variables. Don't use any of the global variables again after any waits.
2. If the action might be called by different units (for example multiple units casting the same spell), you must have dedicated objects for each time the trigger is run. For example, if you are using a dummy caster, you have to create a new one in the trigger to be used for that particular execution, rather than relying on a single caster for every instance.
 
Reaction score
341
Scenario:
  • You cast your spell, for the first time.
  • There is a wait in that spell, so it pauses the first instance.
  • While your spell is paused, another unit casts your spell.
  • Therefore all of the data is overwritten.
  • All the actions you had after the wait will now only work for the active instance.

I'm sure you can see how many bugs can spawn from that scenario.
 

Teach101

New Member
Reaction score
4
Scenario:
  • While your spell is paused, another unit casts your spell.
  • Therefore all of the data is overwritten.
  • All the actions you had after the wait will now only work for the active instance.

I'm sure you can see how many bugs can spawn from that scenario.

Yeah, I can. But why would it rewrite it? After all wouldn't the mui integer need to be used 8,000 times?
 
Reaction score
341
Yeah, I can. But why would it rewrite it? After all wouldn't the mui integer need to be used 8,000 times?

Im talking about if you hadn't stored the information into an unique array index.

Say you used a non-array variable setting the data, it would get overwritten.

Also if you didn't even store the data in a variable, and just used data like GetTriggerUnit()

they would also get overwritten (I haven't tested this, just assuming).
 

Genkora

Frog blast the vent core!
Reaction score
92
event responses are MUI, even with waits.

For example:

Event
A unit starts the effect of an ability
Conditions
Ability being cast equal to some ability
Actions
Wait 5 seconds
Kill Triggering unit

If you were to cast that ability, and then 2 seconds later cast it again with another unit, both units will die after 5 seconds of when they casted the ability. You can also use global locals, a way of defining globals as locals in GUI.

Look here, Tom explains it better than I do.

http://www.thehelper.net/forums/showthread.php?t=51725
 

vypur85

Hibernate
Reaction score
803
> event responses are MUI, even with waits

Not all of them. 'Casting unit' is the best example. So far, only 'Triggering unit' and 'Dying unit' are stable after waits. 'Attacking unit' seems to be stable the last time I checked but I haven't really tested thoroughly yet.

Making things MUI with waits are not hard. You just need to manipulate locals here and there via GUI.

Making MUI stuff with timer is another story. It's not easily achieveable using GUI.


> Why Can't You Use Waits

You can. Just use it if you know what you're doing. That's all.
 

Sevion

The DIY Ninja
Reaction score
413
Why would you use Casting unit anways? Use Triggering Unit whenever you can. ;) Most event responses return Triggering Unit.

Locals are the answer to MUI ;)

Arrays are the answer to MPI ;)
 

Teach101

New Member
Reaction score
4
Why would you use Casting unit anways? Use Triggering Unit whenever you can. ;) Most event responses return Triggering Unit.

Locals are the answer to MUI ;)

Arrays are the answer to MPI ;)

Ask Phenomenon about it. ^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top