Ok, I have been hearing about it for a while, and I apparently have it on my computer (and I didnt even know about it...) and I hear that it's very useful.
But like, what does it do?
How do you use it, for what kinds of things do you use it for....stuff like that.
Anyone know of an FAQ somewhere that I could look up for basic information about Fastloop?
In programming a loop takes a function, and repeats it X number of times, "instantly".
For example, doing:
x = 0;
Loop 10 times{
x + 1
Does X == 10?
Would read TRUE for X == 10, even though it occurs directly after the X+1 statement; That exact same code is equivalent to writing:
x = 0;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
x + 1;
Does X == 10?
Its exactly the same in kliking terms; Think of it as Copy/Pasting the code that you would have Inside of the "Loop" over and over that many times right after the part where you start the loop. Every single one of these events will take place within a single frame, whereas if you simply had "X+1", it would take 10 frames to reach x == 10.
It's not quote "faster" in terms of MMF loops, it's faster because it does a bunch of mini-loops inside of 1 MMF loop.
Say you wanted to add to a counter really really fast, but still be able to sensitively detect values in between. For example, if you wanted to get from 0 to 100 in less then 1 second, but still detect if the counter ever equals 65. You can't do this by simply always adding to the counter, because at 55 loops per second, MMF2 is only going to reach 55 in a second, not 100. If you add 100 to the counter, then you're going from 0 straight to 100. Can't do this either.
So what do you do? You use fast loops.
Start of frame:
Set fastloop to 100
On Loop:
Add 1 to Counter
On Loop
+ Counter = to 65:
Event Fires
This means that within 1 MMF2 loop (55 loops per second) you can go from 0 to 100, but still be capable of firing an event that detects that the counter had to pass 65, to get to 100. Why? Even though you're going from 0 to 100 in 1 MMF2 loop, you're still going through each value, 1.. 2.. 3.. 4.. 5.. etc. This means that as long as you let MMF2 know that the events you're asking for is in a loop, hense the "On Loop", then MMF2 will be capable of detecting those intricate values such as when a counter hits 65, in a visual jump from 0 to 100.
The simple way is not always the best way to learn how something like this works. Unless you truly know how fast loop functions, you wont be able to use it to it's full potential. The most simple way to put it, is exactly how I put it in my first line. A fast loop is nothing more then a mini-loop that runs many loops inside of 1 MMF2 loop.
If by program, you mean coded, then neither have I. What I said was not complex in any way shape or form, so by saying that I can only assume you looked at how much I wrote and not actually read it. I was simply giving an example of how it would be used, so that he can better understand what it does.
My explanation had nothing to do with anything outside of MMF2, because heres the funny part. Never truly cared to learn how loops in coding actually work, I can only assume they're similar based on your confusion of my explanation though.
Please read other explanations before giving your own and assuming it's better.
I did read what you said, what i meant was that someone who hadn't used MMF much before quite probably wouldn't even understand the concept of what a loop was. I know when i started using MMF i never stopped to think that the events were run in any order, it was only when i started learning a language in my computer class that i better understood MMF.
I was merely providing an alternative explaination to someone who make not fully understand how MMF works. I'm sorry for calling your explanation confusing.
Originally Posted by Nick! I did read what you said, what i meant was that someone who hadn't used MMF much before quite probably wouldn't even understand the concept of what a loop was. I know when i started using MMF i never stopped to think that the events were run in any order, it was only when i started learning a language in my computer class that i better understood MMF.
I was merely providing an alternative explaination to someone who make not fully understand how MMF works. I'm sorry for calling your explanation confusing.
Edited by the Author.
Sorry if what I said felt like I was attacking you for attacking me. I was sort of just defending my explanation and I understand what you're saying, so let's just leave it at that.
Is there some architectural difference between the fast loop object and the MMF built in loops? I know that when you call a loop from the fastloop object, it will call the ENTIRE loop before continuing down the event list, even including actions in the exact same event. So if you have
On pressing space:
=Set counter to 1
=Start Loop 0 for 1 loop
=Set counter to 3
On Loop 0:
=Set counter to 2
then the game would actually return 3 when it resolves the frame, not 2. So it would read through the command lind and feed it into the read/eval/print loop as:
=Set counter to 1
=Set counter to 2
=Set counter to 3
instead of the intuitive
=Set counter to 1
=Set counter to 3
=Set counter to 2
if that "Set counter to 2" had taken place as normal code instead of a loop.
Is this the same with the built in MMF looping? Because it seems very very odd to have the code skip to a new event before resolving the current one, but that just seems to be how the fast loop object works.
Originally Posted by Nick! I think simply calling them a "Loop" instead of Fastloop would be easier (and actually more descriptive).
I disagree. That's like telling a 7 year old that you can't subtract 3 from 4 because it just wont work. Exactly what I was taught. Now I get to middle school and suddenly we can but when we do, a whole new negative world is introduced. The term fast loop is misleading I agree, but to just call it a loop would leave room for much confusion later down the line when you start learning how MMF2 actually functions and flows, so that your games can take advantage of it, be more efficient, and allow for more complex things.
Teach more difficult stuff in an easy well explained manner. It's much easier to understand where you're going, if you have a rough idea of the direction you need to be in. That way you aren't walking blind.
Uh, fast loop IS the exact same structure as looping in any other programming language; just like a FOR loop in Java/C++/Scheme/Malbolge. Well maybe not malbolge.