User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Loops in events break scope from that point?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)

    Loops in events break scope from that point?

    I'm using loops to trigger sound effects, this causes all of the objects to be destroyed:



    This just causes the object scoped in the condition to be destroyed:


    Is this intentional that actions following a loop are no longer scoped to the condition?

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    @Phi I think you might have mentioned something about loop scoping at some point?

  3. #3
    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)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    144
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Simply you can take this event apart and put all actions into child events, then put “start loop” action in a single child event. This method may significantly boost the amount of event line, but you will no longer need to care about scope break.

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I just reordered them but it intrigued me that they cause the break in the first place.

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,301
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    Fastloops break any scoping that is currently happening.

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    Fastloops break any scoping that is currently happening.
    Interestingly, this breaks scoping too, even with the loops at the end of the condition:


    But this is fine:

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,301
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    Doing that mirrored comparison is probably a bad idea. If you delete the third condition, it should destroy the star shaped object properly. But honestly, if there are multiple copies of any of these objects, I would just do a ForEach loop to destroy the child objects. Also, why are you using an Always condition instead of the same collision condition for the fastloop line?

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    Doing that mirrored comparison is probably a bad idea. If you delete the third condition, it should destroy the star shaped object properly. But honestly, if there are multiple copies of any of these objects, I would just do a ForEach loop to destroy the child objects. Also, why are you using an Always condition instead of the same collision condition for the fastloop line?
    It doesn't, for some reason I need to check both to match both the start shape with the other object. I'm using an Always since it doesn't matter, it's only running when the parent collision is true.

  9. #9
    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)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    144
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by elvisish View Post
    It doesn't, for some reason I need to check both to match both the start shape with the other object. I'm using an Always since it doesn't matter, it's only running when the parent collision is true.
    Fastloop won't break the actions' scope before it, if these actions' object has been scope down to a specific one.

  10. #10
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    756
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by defisym View Post
    Fastloop won't break the actions' scope before it, if these actions' object has been scope down to a specific one.
    It has been scoped to a specific one, and the fastloop does in fact break the scope unless I put it in a child. I just wasn't aware that any use of fastloops in an action caused the whole event lose scope.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. For Each Loops and Overlap Scope
    By rocketappliances in forum Fusion 2.5
    Replies: 4
    Last Post: 14th April 2015, 05:08 PM
  2. Possible Physics Floating Point or Scope Issue?
    By rocketappliances in forum Fusion 2.5
    Replies: 7
    Last Post: 27th January 2015, 11:58 PM
  3. Replies: 1
    Last Post: 7th November 2014, 07:16 AM
  4. Order of Events for Loops
    By Ethan in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 15th January 2013, 05:33 PM
  5. Stuck on fast loops in floating point movement.
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 29th July 2009, 04:54 AM

Posting Permissions

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