User Tag List

Results 1 to 6 of 6

Thread: [Bug?] Call For-Each via FastLoop doesn't work as intend.

  1. #1
    Clicker Install 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)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    121
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Exclamation [Bug?] Call For-Each via FastLoop doesn't work as intend.

    If you have two individual for-each loops of an object, and put the first one into a fastloop, then call the fastloop and the second for-each loop in the same line, the latter only runs once.


    But, if you call for-each loops directly in one event, everything works as intend.
    Here comes a quick example, I think that might be a bug.
    CallForEachViaFastloop.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    941
    Mentioned
    16 Post(s)
    Tagged
    1 Thread(s)
    I vote bug. This does not seem like expected behavior at all. Curious to know what happens under the hood here.

  3. #3
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,301
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Looks like another case of fastloops messing up scope, as we were discussing in this thread https://community.clickteam.com/threads/106342-Bug-Objects-initialised-and-looped-in-a-same-event

    I bet that green diamond was the most recently created one

  4. #4
    Clicker Install 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)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    121
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Looks like another case of fastloops messing up scope, as we were discussing in this thread
    iirc if there's no for-each in the fastloop, all diamonds are turned into green. so I think something might goes wrong when fusion returns from for-each then fastloop.

  5. #5
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,301
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    I'll explain what I mean.

    If you add a condition to event #4 that scopes only one Active, then the forEach loop will retain that scope. So here, only one Active has an id of 18, and that is the only active that gets colored by the loop "Angel_2":





    So far so good.



    And of course if you don't have any scoping conditions, then ALL the Actives will be colored:




    Also, so far so good.


    But what is happening in your example, I believe, is that the mere insertion of a fastloop call into event #4 breaks the scoping of that event. Fastloops are scope killers - they seem to force events to scope only one instance of any object that they themselves reference, as described in that thread I linked to above. Let's test to see if I was right, and the most recently created object is the one that gets scoped. Nope, it's actually the least recently created object that gets scoped:




    Like I said, fastloops kill the scope only for objects that they themselves reference. So, if we change the "DoSomething" fastloop to reference some other object, suddenly the scoping in event #4 isn't messed up anymore:





    It doesn't have anything to do with ForEach loops. Here's your example without any ForEach loops in it, with still the same problem:


  6. #6
    Clicker Install 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)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    121
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    I'll explain what I mean.

    Fastloops are scope killers - they seem to force events to scope only one instance of any object that they themselves reference
    Oh, I got you.
    Now let's call a fastloop in event #4.
    EV_E.jpg
    if there is no operation about object A in the fastloop, it will resets the scope of object A in event #4 to all object As, unless #4 has already scope object A down to an unique object, as what you said in your bolg.
    If there is an operation about object A in the fastloop, this time fastloop will reset the scope of object A to the latest-created in the fastloop-scoped objects.
    Result_FL.png
    Seems that if you create an object, fusion will put it on the top of the object list, and fuison scopes objects by iterating through the list from bottom to top, testing conditions, then puts the eligible ones to the scoped list: that's why we get 10 instead of 19.
    Result_ID.png

Similar Threads

  1. Call anti-aliasing and call-confing keyboard
    By ryo666 in forum Fusion 2.5
    Replies: 9
    Last Post: 29th October 2015, 03:30 PM
  2. Why doesn't this work..
    By KLiK-iT in forum Fusion 2.5
    Replies: 5
    Last Post: 1st July 2014, 06:48 PM
  3. Load on call doesn't work on android
    By Jack133 in forum Android Export Module Version 2.0
    Replies: 9
    Last Post: 30th July 2013, 09:41 AM
  4. "Force load on call option" doesn't work?
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 21st December 2009, 12:11 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
  •