The Daily Click ::. Forums ::. Klik Coding Help ::. Funny Fastloops
 

Post Reply  Post Oekaki 
 

Posted By Message

mastavasta



Registered
  27/07/2010
Points
  113
23rd October, 2011 at 04:45:39 -

I've encountered a problem recently that I cannot wrap my brain around. The problem is this: I have a few conditions, that test for 3 different outcomes in a scenario (no two will run at the same time). They are triggered by fastloops and are more or less based like this:

+Some event
-Start loop "Fastloop" (some number) times

+On loop "Fastloop"
+ (Negate)"Active" is overlapping "Active2"
-Set Xposition of "Active" to X("Active")+1

+On loop "Fastloop"
+"Active" is overlapping "Active2"
+Flag0 of "Active" is off
-Set Alterable Value A of "Active" to X("Active2")
-Set Flag0 of "Active" on
-Set Xposition of "Active" to X("Active")+1

+On loop "Fastloop"
+"Active" is overlapping "Active2"
+Flag0 of "Active" is on
-Set Alterable Value B of "Active" to X("Active2")
-Stop loop "Fastloop"

I should end with a value for Alterable Value A and a value for Alterable Value B, and Value A should be bigger than Value B.
Now, the problem is, that they don't work correctly. By this I mean the third block of code doesn't ever get executed, even if I purposefully turn the Flag0 on at the start of the frame. MMF2 instead executes the second block.

This is where it really gets weird: If I put those blocks of code into a group, have it inactive by default, and remove the "On loop 'Fastloop'" conditions, I get the desired result. The code, for those who need it, would then look like this:

+Some event
-Activate Group "Fastloop"

GROUP. "FASTLOOP":
----------------------------------------
| + (Negate)"Active" is overlapping "Active2"
| -Set Xposition of "Active" to X("Active")+1
|
| +"Active" is overlapping "Active2"
| +Flag0 of "Active" is off
| -Set Alterable Value A of "Active" to X("Active2")
| -Set Flag0 of "Active" on
| -Set Xposition of "Active" to X("Active")+1
|
| +"Active" is overlapping "Active2"
| +Flag0 of "Active" is on
| -Set Alterable Value B of "Active" to X("Active2")
| -Deactivate Group "Fastloop"
------------------------------------------------

As mentioned before, this works perfectly, every time, no questions. Now, I don't think I'm a newbie with fastloops, but I have just returned from a long break and I'm a bit rusty. I can post a link to the .mfa file if you want.

Thanks in advance,
Mastavasta

 
Go into my head, then come back out and tell me I'm wrong.
   

Post Reply



 



Advertisement

Worth A Click