User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: Is there a way to make a fastloop like this?

  1. #11
    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,740
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    In fact, you can't change the loopindex from outside the loop. Cause the loop would start and finish before the action ever runs.
    That's kind of true, but not entirely:



    In a sense, you're right, because we're still technically inside the "fred" loop when we change the loopindex...but only indirectly. We're directly inside the "barney" loop, yet we can meaningfully change the loopindex of "fred" from there. We can see it worked because "fred" was originally supposed to create 10 (x2) shapes, but only created 5 (x2).

  2. #12
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    770
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well I just said cause I think they were trying something like this:



    The loop would finish before even getting to the second action.

  3. #13
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Jun 2014
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    Of course it will crash, if you continuously set it to a specific index it will never finish.
    Ok, I think that's probably what I missed

    But actually, you can set the loopindex if you do it on a single iteration from within the same loop, and Fusion won't crash.

    But like I said before, you still have to use up a loop to do the check & at least one condition to scope the loop step.

    At that point you might as well just use conditions, seeing as it wouldn't take much of a miscalculation to crash fusion with set loopindex.

  4. #14
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    770
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Conditions means it would need to compare values on every single instance of the loop, while setting loopindex would skip this entirely. So it would be effectively doing more work.
    Here's a simple example, although the performance difference might not be much on a small loop called once, it will stack up with other events and can become a problem later on.
    So setting the loopindex is a better approach.


  5. #15
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    979
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    Conditions means it would need to compare values on every single instance of the loop, while setting loopindex would skip this entirely. So it would be effectively doing more work.
    Here's a simple example, although the performance difference might not be much on a small loop called once, it will stack up with other events and can become a problem later on.
    So setting the loopindex is a better approach.

    Thanks a lot! I did something like this and it appears to work perfectly.
    What I’m trying to accomplish is boost the performance of my roguelike by reducing the amount of map tiles it has to check in order to move monsters around. It went from checking a 32 x 32 grid to a (player Y-5, player X-5) to (player Y+5, player X+5) section and it’s speeding things up a bunch.

  6. #16
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    770
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Alright, so since you already had it all set up for a higher loop you needed a simple way to adapt it to work with a smaller amount of loops, got it.
    Glad it worked!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Please help with fastloop example
    By Emerson3 in forum Fusion 2.5
    Replies: 2
    Last Post: 7th January 2017, 05:36 AM
  2. Can a Fastloop run within another Fastloop?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th November 2011, 11:48 PM
  3. fastloop help
    By falkon in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th April 2008, 11:14 PM
  4. Fastloop bullets example
    By DavidN in forum File Archive
    Replies: 3
    Last Post: 22nd April 2007, 12:13 AM
  5. Bug: Fastloop
    By Sphax in forum File Archive
    Replies: 7
    Last Post: 15th November 2006, 11: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
  •