1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

MUI Triggers with Waits

Discussion in 'Trigger (GUI) Editor Tutorials' started by Magtheridon96, Jun 26, 2012.

  1. Kaoskid

    Kaoskid

    Joined:
    Sep 8, 2012
    Messages:
    5
    Resources:
    0
    Resources:
    0
    I tried to implement this on my spell but i keep failing :X what am i doin wrong?
    • Set WriteIndex = (WriteIndex +1)
    • Set CurseCaster[WriteIndex] = (Triggering uit)
    • Set CurseTarget[WriteIndex] = (Target unit of ability being cast)
    • Set ReadIndex = (ReadIndex +1)
    • Wait until ((CurseTarget[ReadIndex] is dead) Equal to True. checkingg every 0.10seconds
    • Unit - Create 2 (Unit-Type- of CurseTarget[ReadIndex]) For player 1 (Red) at (Position of CurseTarget[ReadIndex]) facing Default building facing degrees
    • Set CurseSpawnedUnit[ReadIndex] = last created unit
    • Wait until ((CurseSpawnedUnit[ReadIndex] is dead) Equal to True. checkingg every 0.10 seconds
    • Unit - Create 4 (Unit-Type- of CurseTarget[ReadIndex]) For player 1 (Red) at (Position of CurseTarget[ReadIndex]) facing Default building facing degrees


    The spell works fine, but when another person starts the same spell, it messes up the first spell, all units spawn in the position of the last target Unit of ability being cast..how can i fix this?
    (PS- any one know how i can create the 4 units after (Both) previous units are dead and not just the last created unit)
     
  2. rulerofiron99

    rulerofiron99

    Joined:
    Jul 10, 2006
    Messages:
    3,129
    Resources:
    14
    Maps:
    4
    Spells:
    9
    Tutorials:
    1
    Resources:
    14
    The ReadIndex = ReadIndex + 1 needs to be after the wait.
     
  3. Kaoskid

    Kaoskid

    Joined:
    Sep 8, 2012
    Messages:
    5
    Resources:
    0
    Resources:
    0
    I just tried that it didknt work.

    Wait until ((CurseTarget[ReadIndex] is dead) Equal to True. checkingg every 0.10seconds
    Set ReadIndex = (ReadIndex +1)
    Unit - Create 2 (Unit-Type- of CurseTarget[ReadIndex])

    If i put it after wait then, trigger is gonna wait until ((CurseTarget[ReadIndex] is dead and since Set ReadIndex = (ReadIndex +1) is right after it, Its gonna wait until CurseTarget0 Is dead and there is no such unit so it will just skip it and spawn the 2 units
     
  4. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I'm sorry, but this can't be used with the "Wait until" action :/

    The whole thing depends on the order of the execution of the actions.

    This is why the last part of the tutorial that shows you how to make MUI Spells without waits is what I want readers to concentrate on.

    edit
    Also, you have more than 1 unit being created, so the spell will wait for one unit to die before it continues to do the actions after each wait.
     
  5. Kaoskid

    Kaoskid

    Joined:
    Sep 8, 2012
    Messages:
    5
    Resources:
    0
    Resources:
    0
    ohh damn :(
     
  6. privatenumber

    privatenumber

    Joined:
    Mar 10, 2012
    Messages:
    10
    Resources:
    0
    Resources:
    0
    I see..as a newcomer this guide is very handy and useful :) thx!
     
  7. Siryan

    Siryan

    Joined:
    Aug 9, 2012
    Messages:
    81
    Resources:
    0
    Resources:
    0
    What would be really useful for extraordinaire noobs like me in coding is to tell viewers in your GUI tutorials from here on out what you're setting each variable to. If it's a more extensive tutorial with like 10+ triggers I wouldn't recommend that but, considering the short length of the GUI you're showing off, saying what variables your using would be useful to me.

    I have 2 custom skills in my map that rely on a wait so as to cause a delayed action to happen after the wait. They are waits of 1.07.

    Aside from all the above, Thank You for making this.
     
  8. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I have made some minor modifications and improvements to the tutorial.

    This thing is so lulzy
     
  9. Hell_Master

    Hell_Master

    Joined:
    Nov 29, 2012
    Messages:
    5,512
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Very useful tutorial. Quite entertaining to read it and also learned a lot on this. I didnt know Waits can cause a lot of trouble like that....

    Thanks and +3 REP!
     
  10. Siryan

    Siryan

    Joined:
    Aug 9, 2012
    Messages:
    81
    Resources:
    0
    Resources:
    0
    What's so lulzy? Your tutorial or my remark, lol.
     
  11. BETABABY

    BETABABY

    Joined:
    May 28, 2015
    Messages:
    352
    Resources:
    8
    Icons:
    8
    Resources:
    8
    I have no idea what I'm reading.. Like I'm so confused right now hahaha how is this and how is that LOL

    I must be high or something.
     
  12. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Maaaaaaan, I wrote this when I was 15.
    I'm 19 right now and this is trippy as hell.