HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Lost on a specific integer

07-04-2004, 06:45 PM#1
NeoChocobo
I have always been wondering, what are the uses for "For Loop Integer A" and "For Loop Integer B" are. I need an example and how they are used, cus i get a loss of idea what to do next, and i just wondered if this is a useful integer, or just something blizzard threw in there for "when that time calls for".
07-04-2004, 08:38 PM#2
Porsche911R
You use it when you want to do the same action more than once.
i.e. if you wanted to give vision to players 1 through 10 without having to make 10 diffrent triggers you'd use the loop

For each integer A from 1 to 10, do (Create an intially enabled vision modifier for player(IntegerA)...

to make 1 trigger do the same thing as if you had created 10 triggers.
07-04-2004, 10:56 PM#3
Anitarf
Yes, loops are one of the most useful things in the trigger editor, right after the if-then-else. They repeat the commands that are in them, and each time they repeat them with a different number: Porsche gave a nice example of how that number can be used.

Another good use for loops besides doing some things for all players, is to use them in conjunction with arrays (arrays are variables that can hold multiple values; like a real variable that can store more numbers. Each different value in an array has it's own integer number which you define when you store the value to the variable; with loops, you can then easily acces multiple such values without typing a hundred lines of code)
07-05-2004, 10:57 AM#4
NeoChocobo
wow!! omg i've been doing it the hard way all this time. thx a bunch from both of you guys, u really helped me out