Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Using Integer A, which is a global variable, in a non-instant way. Basically if any other Integer A loop runs during that time it will break.
Solution is to use either a local variable (JASS) or a unique global variable for this trigger (if only 1 thread of the trigger can exist at any time). If the trigger can fire multiple times at once then one has to use an instancing system.
Might also be a good idea to use a timer instead of Wait as timers are accurate to game time.
You can also locally shadow Integer A so it behaves as a local integer (like Dr Super Good suggested JASS can do) but can be accessed in GUI by putting this as the first line of your actions:
You can also locally shadow Integer A so it behaves as a local integer (like Dr Super Good suggested JASS can do) but can be accessed in GUI by putting this as the first line of your actions:
Try without the = 0 part. That should have worked; local integer shadowing has been a thing for years. If it still doesn’t fix the problem, then you should just use a new variable for a For each integer VARIABLE do...
@Pyrogasm Not quite.
Referencing Integer A in GUI calls a Blizzard.j function which will return the value of the global variable.
For this to work you'd have to shadow both bj_forLoopAIndex and bj_forLoopAIndexEnd and read from bj_forLoopAIndex directly inside the loop.
Actions
Custom script: local integer bj_forLoopAIndex
Custom script: local integer bj_forLoopAIndexEnd
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Custom script: set udg_IntVar = bj_forLoopAIndex
At this point you might as well just use a unique global variable as the doctor suggested and shadow it if needed.
I actually had no idea the end index was stored globally; makes complete sense, but I didn't think about it. Since you can't shadow two variables that won't work either. I also had it as IndexA rather than AIndex, which is other the reason what I wrote didn't work. All around not a good solution to try shadowing.
Use a For Each Integer Variable loop instead of the Integer A one and create a new unique integer variable for it.
Let the floating text destroy itself so that we don't have to worry about the Last Created Floating Text getting overwritten elsewhere during the wait.
If the trigger cannot run more than once at a time, you can drop the custom script action, otherwise make sure the variable name in the custom script matches the name of your loop variable but with the "udg_" prefix attached.
Actions
Custom script: local integer udg_MyIntegerVariable
For each (Integer MyIntegerVariable) from 1 to 3, do (Actions)
Loop - Actions
Floating Text - Create floating text that reads countdown[MyIntegerVariable] at (Center of duelmainlocation) with Z offset 0.00, using font size 30.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Tested and I was able to shadow two integers properly. Was the single variable thing just a myth perpetuated from years ago? I remember it not being a viable solution for MUI-ability in GUI many times because you couldn't shadow too many variables.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.