User Tag List

Results 1 to 7 of 7

Thread: Fastloop Issue

  1. #1
    Clicker Multimedia Fusion 2 Developer
    Teh_Purple_d00d's Avatar
    Join Date
    Oct 2010
    Location
    Versailles, MO, USA
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fastloop Issue

    I'm having an issue getting Fastloops to move an active object properly. By itself, this issue doesn't occur, but when there are multiples of the same object on screen, then the issue arises. Allow me to clarify:

    Alterable Value A ("Item Object")<> 0 >> Start Loop "Move Items" Abs(Alterable Value A("Item Object")) times

    Alterable Value A ("Item Object") < 8 >> Add 0.5 to Alterable Value A

    On Loop "Move Items"
    Alterable Value A ("Item Object") < 0
    >> Set Y Position ("Item Object") To Y ("Item Object") -1

    On Loop "Move Items"
    Alterable Value A ("Item Object") > 0
    >> Set Y Position ("Item Object") To Y ("Item Object") +1

    On Loop "Move Items"
    Alterable Value A ("Item Object") < 0
    ("Item Object") is overlapping a backdrop
    >> Set Y Position ("Item Object") To Y ("Item Object") +1

    On Loop "Move Items"
    Alterable Value A ("Item Object") > 0
    ("Item Object") is overlapping a backdrop
    >> Set Y Position ("Item Object") To Y ("Item Object") -1
    Seasoned MMF users can tell that this code handles the vertical movement of an item within the game I'm working on. It allows items to pop out of defeated enemies and fall seamlessly to the floor below.

    However

    Let's say you make an item appear. Then a few frames later another item appears. The alterable values of each item screws with their movement speed, slowing them down until both are falling towards the ground. Items in the game are done using a single active object. I just want both items to fall to the ground without that slowdown issue. I've tried Spread Values, but it didn't seem to fix it. Any other thoughts?

  2. #2
    Clicker Multimedia Fusion 2
    Algul's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    Well this is perfect example for ForEach extension. In cases like this, every object needs to be handled individually.

    View MFA

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    When you are handling multiple instances of an object you need to spread 0 through one of the object's alterable values and then run a fastloop for the number of objects... then you would put an additional condition in the fastloop that checks to see if the object's alterable value is equal to the loop index. This way it will check each and every object.

    What you have now is not doing that at all... it would only work for a single object. I think what is happening in the current situation... the "slow down" is caused by the fact that not all objects are moving during a single game loop. The game is moving the objects one at a time each loop when one of the objects meets the conditions... So it is doing something like "you go, then I go" instead of "we all go".

    edit: and oh yeah, forgot to mention the foreach extension but that would definitely be a good place to use it, as mentioned above.

  4. #4
    Clicker Multimedia Fusion 2 Developer
    Teh_Purple_d00d's Avatar
    Join Date
    Oct 2010
    Location
    Versailles, MO, USA
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    @Konidias:

    I tried your method first, but then I lose the variable speed I had in the original events. (It just moves a single pixel per frame and overall looks very unnatural.)

    I've uploaded an example to show you what I mean.

    Example File

    @Algul

    Your method didn't work for me at all. But that probably because I haven't used the ForEach object before. An example would be beneficial.

  5. #5
    Clicker Multimedia Fusion 2
    Algul's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    i did included example.

  6. #6
    Clicker Multimedia Fusion 2 Developer
    Teh_Purple_d00d's Avatar
    Join Date
    Oct 2010
    Location
    Versailles, MO, USA
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    Wow, I'm an idiot. I thought that page just took me to the extension. My bad. And thanks.

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fastloop Issue

    Quote Originally Posted by Teh_Purple_d00d
    @Konidias:

    I tried your method first, but then I lose the variable speed I had in the original events. (It just moves a single pixel per frame and overall looks very unnatural.)
    You can nest fastloops. So you can first start a fastloop for the number of objects, and then inside that fastloop you can fastloop based on the speed variable you have.

Similar Threads

  1. Fastloop and active object collision issue
    By prester in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 14th April 2012, 06:26 PM
  2. Can a Fastloop run within another Fastloop?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th November 2011, 10:48 PM
  3. MMF2 - Datagrid Object and FastLoop Issue
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th August 2008, 03:39 AM
  4. fastloop help
    By falkon in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th April 2008, 10:14 PM
  5. Bug: Fastloop
    By Sphax in forum File Archive
    Replies: 7
    Last Post: 15th November 2006, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •