The Daily Click ::. Forums ::. Klik Coding Help ::. need help w/ fast loops
 

Post Reply  Post Oekaki 
 

Posted By Message

NMasutaa



Registered
  26/12/2004
Points
  301
30th May, 2007 at 20:48:15 -

Does the MMF2's built-in fast loop usually work well? I've never used fast loops before, and right now I'm trying to use it to quickly subtract from a value that is then checked by another event to stop the loop.

However, with my code, it seems that starting the loop isn't doing anything to the value at all.

(object) reaches the end of its path
start loop "Countdown"

On loop "Countdown"
subtract 1 from Value B

Value B = Value A
stop loop "Countdown"

Also, does setting the number of times looped to 0 cause the loop to go on infinitely?

 
n/a

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!
30th May, 2007 at 20:50:56 -

Loops get the highest priority and are started and finished before the next event, unless you give it a "on loop" event. So to get it working, do:

On loop "Countdown"
+ Value B = Value A
stop loop "Countdown"

Infinite loops are impossible and NOT recommended. It'd crash your game, being stuck in an infinite loop.

 
Old member (~2004-2007).

Kablobah



Registered
  26/05/2007
Points
  13
31st May, 2007 at 15:53:13 -

Can you not get infinite loops by making it run a negative number of times?

 
n/a

Neuro

Ludologist

Registered
  29/10/2006
Points
  437

Game of the Week WinnerVIP MemberI'm on a BoatPokemon Ball!
31st May, 2007 at 16:14:16 -

It crashes, I've had it happen by accident a fair bit (forgetting to multiply by -1 ).

 
n/a

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!
1st June, 2007 at 02:42:16 -

Strange that it crashes. Seeing as how a C++ loop works, it'd rather just skip the "on loop" event at all.

 
Old member (~2004-2007).

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
1st June, 2007 at 04:46:15 -

on loop "loop"
-> run loop "loop" 10 times.

That should cause it to crash after a while

Obviously you need to start the loop first.

Image Edited by the Author.

 
My signature is never too big!!!
   

Post Reply



 



Advertisement

Worth A Click