User Tag List

Results 1 to 5 of 5

Thread: Strange loop behavior. Help?

  1. #1
    Clicker Fusion 2.5 DeveloperInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Sep 2016
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange loop behavior. Help?

    I have two duplicates of an Active object, and one Platformer Movement Object. I have this code that automatically creates and binds PMOs with their corresponding Active objects.

    Code:
    Start of Frame
      Group.Physical Objects: Spread value 0 in SpreadA
      Platform Movement Object: Spread value 0 in Spread A
    Start of Frame
      Runtime: Start loop "CreatePMOForEach" NObjects("Group.Physical Objects") times
    Sidenote: It's hard to copy code by hand. Is there a way to copypaste it somehow?

    Anyways, if I put the Start Loop action into the first event, only one object will have the spread value, but if I put it like this, then both get the correct spread value.

    https://www.dropbox.com/s/3y1eonpaib5byzx/Test.mfa?dl=0 Here is my MFA file so you can see what's going on. The two squares should drop down, but if you put the Start Loop action into the first event, only one will fall. I don't know why that is so and I'd like it if someone could please explain it to me. I'm seriously confused when these things happen and I think that nothing is exact in computers. I get mystifications and lose inspiration.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to be a weird bug in Fusion 2.5 that causes this.

    I have tried to figure it out, but it got just more weird the more I tried to figure it out.

    I have made a simplified version to showcase the bug in this mfa.

    Somehow, spreading a value in an active object, then starting a fastloop where the value will then be compared against the spread value causes problems if the loop is started on the same event as the value is spread.

    You can check the comment I have added in the event editor for the different outcomes that can happen.
    Attached files Attached files

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,521
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    This is a known quirk which relates to how the two functions work and how the Fusion runtime works.

    As Popcorn put it back in 2008: "You can never start a loop in the same event as you spread values, that simply doesn’t work."

    Or as Fernando Vivolo put it earlier this year: "the issue is that spread value works on actions loop so is not good to be executed with other actions (unless you want to do something in this loop, among the spread value, be aware not all objects will works,), for safety must be executed alone so it will executed as many time need it and preparing the spread values."
    .:::.Joshtek.:::.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,736
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Hi Zvoc47. I reference your question about your coding. Taking a screen shot of your events might work for that.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clicker Fusion 2.5 DeveloperInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Sep 2016
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, Decal has uploaded an explanation to this problem. I guess I'll just stick to this:
    Code:
    Start of Frame
    OR (Logical)
    Always
      Group.Physical Object: Spread 0 to SpreadA
      Group.Physical Object: Spread 0 to SpreadB
      PMO: Spread 0 to SpreadA
      PMO: Spread 0 to SpreadA
    I put that above all the code so that I can iterate through all objects. I'm only worried about what if the object count drops due to objects getting destroyed and if the objects don't get iterated through because of that. I might just spread values upon destroying either a physical object or a PMO.

Similar Threads

  1. strange behavior for sub.app under swf
    By Fernando in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 1st April 2011, 02:02 PM
  2. Strange behavior from two PNG files...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 2nd October 2010, 12:00 AM
  3. Strange Counter Behavior
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th October 2008, 06:23 PM
  4. Strange Bounce behavior... help
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 2nd October 2008, 05:13 PM
  5. Really Strange Group Behavior...
    By xerus in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th September 2007, 07:48 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
  •