• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] 1 local variable for GUI?

Status
Not open for further replies.
Level 9
Joined
Sep 28, 2004
Messages
365
As the title goes, what does this mean? I read the MUI spell at the tutorial section and saw the warning.

Warning The first suggestion for local variables is incorrect. While the use of multiple local variables is demonstrated, in fact only ONE local variable can be used in GUI. Until the tutorial is updated, please keep this in mind and either use only one local variable in GUI or consider using JASS for spells.

I don't really get what does this mean. Does that mean the tutorial shown below doesn't work as it uses more than 1 local variable?
Hero Revival from thehelper.net

Or does it mean that when i use customscript for local vars, i need to use all custom script for the rest of the code without touching any GUI triggers?

Thanks for any clarification!
 
Level 14
Joined
Nov 18, 2007
Messages
816
Oh my, that second tutorial you linked to...meh.

Anyway, the limitation mentioned in the first tutorial only applies to the occasions in which you deliberately give the declared local the same name as a global has. This allows you to use the local inside the trigger (with certain limitations...). But that bug only works once per trigger, afaik.
 
Level 9
Joined
Sep 28, 2004
Messages
365
Ah thanks for the quick reply and clarification.
Why is it meh? :x

Another question about MUI.

  • spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blizzard
    • Actions
      • Set caster = (Casting unit)
      • -------- Do something --------
Lets say if the ---- Do Something ----- have 50lines of GUI triggers and assuming codes below uses "caster" variable. If 2 person cast at the same time or 0.1sec later, won't it overlap the 1st person since it will replace the caster variable. I know 50lines can be executed instantly, but sometimes it will be replaced. For example loops, even without wait.

How do we ensure it is 100% MUI in this case? Sorry for bad english.
 
Last edited:
Level 9
Joined
Sep 28, 2004
Messages
365
Its 100% MUI.
As long as you use only one trigger and no waits, the spell should be 100% MUI.
Also, it is not required for you to set Casting Unit to a variable. Just use Triggering Unit, it works even if you use waits :D

That cleared me up [: Although using a loop will cause MUI to break in a small chance. I just tested it on my map to transfer item to another hero when a player advance classes. If two people use it at the same time, the items will be messed out around the 2 players. But i solved it without storing the casting unit to a variable as they are locally called (the way i understand).

Thanks again! Now i can make MUI spells in peace [: +rep!
 
Status
Not open for further replies.
Top