Hey guys, I've got no idea what fastloop is or how to use it but from the sounds of things its very useful/important so I'm going to look into it. Well, I would if i could actually locate it... Is it a seperate extension for MMF2 or built in?
Fastloops are used to create "loops" that help you repeat actions many times per event loop. Yes, it's built in, just look under the "special" object in the event editor. This is how it works:
Let's say you want to create 5 active objects somewhere, when spacebar is pressed. So, normally, you would do something like this:
* Upon pressing a key: Spacebar
- Create "Active1" at (100,100)
- Create "Active1" at (100,100)
- Create "Active1" at (100,100)
- Create "Active1" at (100,100)
- Create "Active1" at (100,100)
But instead, you can use a fastloop to do the same thing:
* Upon pressing a key: Spacebar
- Start loop "foo" 5 times
* On loop "foo"
- Create "Active1" at (100,100)
So what it does, is it starts a loop named "foo" for 5 loops. Then, for each loop, it creates an Active1 object at (100,100). All Active1 objects will appear at the same time. You can also add conditions to an "on loop" event, (Note: The "on loop" condition always have to come first, it won't work otherwise) like this:
* On loop "foo"
* Score > 5
- Create "Active1" at (100,100)
Fastloops are also nestable, which means you can place a fastloop inside another fastloop:
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
28th July, 2007 at 16:07:17 -
Don't forget the useful loop index counter!
Before
On blah:
Create object on (100,counter*50)
Add 1 to counter
Create object on (100,counter*50)
Add 1 to counter
Create object on (100,counter*50)
Add 1 to counter
Create object on (100,counter*50)
Add 1 to counter
Create object on (100,counter*50)
Add 1 to counter
After
On blah: start loop "FUBAR" 5 times
On loop "FUBAR":
Create object on (100,loop index("FUBAR")*50)
Note that this is all pseudocode. You can find the loop index as a function in the expression editor.