User Tag List

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

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

  1. #1
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    978
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to make a fastloop like this?

    Hi!

    Stupid question I'm sure but I know fastloops start from 1 and go to whatever you specific (ex run loop 32 times).

    My question is can you have it start from a number other than 1? Like in the old days if I wanted a loop to run from 5 to 15 I could just write For X = 5 to 15.

    I don't want to make all the conditions (fastloop index +5) because I'd have to change a lot, so was hoping I could just change the numbers in that initial fastloop instead.

    Thank you for your help!

  2. #2
    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
    286
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    IIRC there is an action that allows you to set loopindex.

  3. #3
    Clicker Fusion 2.5Fusion 2.5 Mac
    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)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    880
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    I think if you set an event that says LoopIndex("YourLoop") is greater than 4, you would get what you want.

  4. #4
    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
    766
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Why not just getting loopindex and adding the offset?...
    So whenever you need to get the loop index do it like: LoopIndex("YourLoop") + 5 (or any other offset value)

    Would be just inefficient and quite odd to do tons of loops but only do something in the middle...

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    378
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    like that?

    loopindex.mfa

  6. #6
    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)
    Don't think there's a way around having to add 2 additional conditions (using 'compare 2 general values') to the 'on loop' trigger to keep the value clamped to within that range. There is an action to set the loop index as defisym says, but you still need to waste at least 1 loop to check for it & you still need the additional conditions. It's also pretty slow which may or may not be an issue, depending on your use-case.

  7. #7
    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
    766
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Like I said, you don't need conditions, the whole point you want to skip some indexes is so loopindex returns something in between 5 and 15 for example, right?
    So if you're using loopindex for something you can just use loopindex + start number...
    If you're not using loopindex anywhere, then what's the point of having loopindex starting in a different number?

    So here's a example showing two uses: Selecting object from one ID using a loopindex+offset and the other is adding to a list (or any setting any value) with loopindex+offset, which doesn't require any extra condition.
    loopindex.mfa

    If you have too many conditions or expressions to change, you'll have to deal with it and replace it, doing dirty workarounds will cause problems afterwards...
    But if you really want to workaround this, setting the loopindex won't cause any delay whatsoever, cause a loop will start and finish before going to the next normal event or even action if it was called in between those.
    It won't cause any delay, it won't cause any performance issue, it's actually lighter than using a condition cause it doesn't have to check multiple times for something.

  8. #8
    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)
    Im doing some crude experiments with the 'set loopindex' action, and I can't envisage a scenario where you're able to only use that action and still keep the values scoped within that range. In fact it seems to really add nothing at all.

    If you set koopindex to 5 after you start the loop, how are you able to keep track of what iteration it's on without another condition in your on loop event?

    Something else I discovered however, is that trying to set loopindex from inside the same fastloop (as in on an "on loop" event), will actually crash Clickteam Fusion.

    If anything, it's probably better to just not use set loopindex at all & stick with the more stable additional conditions method.

  9. #9
    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)
    I did also try to see if I could gauge it's performance using the microtimer object to see if it was as slow as I thought I remembered it being, but it turns out in my limited experiments that it made no difference one way or the other. Setting the fastloop index to 5 was no faster or slower than just waiting for the fastloop to reach 5 iterations & using an on loop event + conditions to scope it.

    For the record, my "test" basically consisted of running a loop 32 times & creating objects when the loopindex was between 5-15, and seeing how long the loop took to reach its endpoint, trying to see if there was any performance difference if you set the loop index to 5 or not (which there wasn't), so far from an exhaustive test. The crash is legitimate, though.

  10. #10
    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
    766
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by YesNoYes View Post
    Something else I discovered however, is that trying to set loopindex from inside the same fastloop (as in on an "on loop" event), will actually crash Clickteam Fusion.
    Of course it will crash, if you continuously set it to a specific index it will never finish, meaning it will be a infinite loop, causing the crash.
    If you just use a "only one action when event loops" condition it won't crash. In fact, you can't change the loopindex from outside the loop. Cause the loop would start and finish before the action ever runs.

Page 1 of 2 1 2 LastLast

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
  •