Loop index tells you how many times a fastloop has gone through its events. Every time a fastloop checks all conditions you give it, it adds one to this "counter." So if you run a loop (we'll call it "Kalamazoo") you can use the loop index to do a few things.
For example, you can run through a set of objects after using spread value to set the objects' alterable value A.
Start of frame: Spread value 0 in active alterable value A. (This numbers the actives)
Upon pressing space: Start loop "Kalamazoo" (number of actives) times.
On loop "Kalamazoo"
+ Active Value A = Loop index "Kalamazoo": Set active X to Loop Index "Kalamazoo" * 15
That system would take one active at a time and place it 15 pixels to the right of the previous one. You can also use loop indexes to go through a list. And other things.
a loop is defined to run a certain ammount of times BY you.
loopindex("loopname") simply tells you where in the loop it is at this very moment. its also 0-based index. so it loops from 0 to n-1, n being the number of loops you told it to do.
Originally Posted by Jon C-B I think the Loop Index expression thing might be what I'm looking for in my game, but Im not sure. What does it do exactly?
Er, instead of asking whether random things are what you need.. why don't you ask people what it is you need?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.