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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top