The Daily Click ::. Forums ::. Klik Coding Help ::. Fastloop
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
27th July, 2007 at 06:17:08 -

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?

 
Image

Tell 'em Babs is 'ere...

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
27th July, 2007 at 06:47:10 -

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:

* On loop "foo"
- Start loop "bar" 5 times

* On loop "bar"
- Create "Active1" at (100,100)


I hope this helps!

 
n/a

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
27th July, 2007 at 09:29:11 -

Wow, thank you very much!

 
Image

Tell 'em Babs is 'ere...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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.

 
Old member (~2004-2007).

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th July, 2007 at 16:23:19 -

To clarify what DaVince just said: You can get the loop step of any fastloop by using the LoopIndex() function. For example: LoopIndex("foo")

Another good thing to remember: After a fastloop has finished, MMF continues from the event that triggered the loop

 
n/a
   

Post Reply



 



Advertisement

Worth A Click