HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Integer A-B MUI ?

05-21-2007, 08:59 PM#1
PsychoPif
Are the variable Integer A and B used in loops global or local ?

I ask because I have two trigger that uses loop integer A and they seems to be conflicting. In one of them, I check to see at which integer I am and it look like it is affected when I run the other one.
05-21-2007, 10:08 PM#2
Pyritie
Global.

Just use "For each Variable..." instead of "For each Integer A/B..." and have a seperate variable for each trigger.
05-21-2007, 10:51 PM#3
Here-b-Trollz
Yes, they conflict. You will need to use a custom script (assuming you are using GUI) action with

Trigger:
CustomScript - local integer a = 1
CustomScript - loop
CustomScript - exitwhen a == 12
CustomScript - Your actions (doesn't have to be custom script)
CustomScript - set a = a+1
CustomScript - endloop

in each trigger, to run your loop, and avoid the conflicting variables.



EDITED for case sensitivity (to avoid confusion)
05-22-2007, 02:15 AM#4
Vexorian
Custom script is case sensitive, and it is usually needed to use the index in the actions.
05-22-2007, 05:08 AM#5
Pyrogasm
No fucking way. So you're telling me that all those times I used Integer A loops in GUI with waits... they were fucking each other up?

Dear god, Blizzard, WHY?!
05-22-2007, 05:37 AM#6
Ammorth
Not only that, but GetForLoopIndexA() is used instead of just using the global variable bj_forLoopAIndex (slow function calls).
05-22-2007, 02:42 PM#7
PsychoPif
Thanks all for the info.