User Tag List

Results 1 to 6 of 6

Thread: [Bug] Objects initialised and looped in a same event

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    DavidT's Avatar
    Join Date
    Sep 2011
    Posts
    160
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    [Bug] Objects initialised and looped in a same event

    Hello, here is a bug in Fusion 2.5 that I often encounter. When you initialise several instances of an object, and in the same event line you change their value in a loop, the last object (newer object) stays in the initial state. Clickteam could you please fix it ?
    Attached files Attached files

  2. #2
    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)

    Join Date
    Feb 2017
    Posts
    338
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    If you want it in the same event line you can use a "for each loop" and it works.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    DavidT's Avatar
    Join Date
    Sep 2011
    Posts
    160
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Oups, wrong section, it's not a problem with the HTML5 exporter but with Fusion. Can an admin move the topic please?

    Yes Manuel, we can do it the way you say, but It should work without too.

  4. #4
    Clicker Fusion 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)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    167
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That's bizarre - if you use another action like "make object invisible" or "destroy" it behaves the way you would expect and scopes *all* of the objects

  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,243
    Mentioned
    87 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    That's bizarre - if you use another action like "make object invisible" or "destroy" it behaves the way you would expect and scopes *all* of the objects
    Not completely. If you put a make invisible action in the fastloop like this, then it appears to behave as expected (they all go invisible):




    ....but then if we add another event to let us take a peek at the previously hidden objects, and press spacebar, we see that things are not all kosher:




    And if you put a make invisible action in the first event, it has the same bug as before (one of the objects remains invisible):



    I have two hunches about this. My first hunch is that this is a combination of two bugs. The first bug is that a calling a fastloop will break scope for objects if those objects are also referenced by the fastloop. So this, for example, works fine, because the fastloop no longer references the teal object:




    But as soon as you add a reference to the teal object inside the fastloop, the scoping for the teal object is broken in event #5:





    I did a bit of investigating into scope a while back and I remember concluding that fastloops and scoping just don't mix. I think shaku88's example is a variation of the bug I found in the "Example fastloops #5" example in that link:




    Though I don't think I realised the problem was as serious as shaku88's example. I think I probably thought it was confined to certain conditions and/or newly created objects. I didn't realise that it even broke 'scope' for events that don't even contain active objects in the conditions.

    So I think what's going on in shaku88's example, is that the 'scope' of the event is 'all active objects' (since shaku88 hasn't actually scoped any particular objects in the conditions), but the fastloop manages to break even that 'scope', and so the action ends up only executing on the most recent object.

    The second bug that I think might be going on is that the fastloop is being executed before the other action. So I think that what's happening might in a sense be the reverse of this:

    When you initialise several instances of an object, and in the same event line you change their value in a loop, the last object (newer object) stays in the initial state

    This is shaku88's code:



    But notice that you'll get exactly the same outcome with the following code:



    I believe that this variation is the one that Fusion is actually doing. It executes the fastloop, and then it moves Active Object to 150. If this is the case, then it really should move all the objects to 150. But because the fastloop has broken the scope (as shown above), it only moves the most recent one. I might be wrong about this part, though, and the more I think about it, the more I think I probably am. For one thing, I have absolutely no idea what's going on here:



    This one just is just bizarre. It first moves the second-most recent object to 300, then moves all but the most recent and second-most recent objects to 200, then moves the most recent one to 100!


    So that's my first hunch: that the fastloop is both messing up the 'scope' and (maybe)being executed earlier than it was supposed to, resulting in this very counter-intuitive result.


    My second hunch is simply: that we'll never see this issue fixed before Fusion 3. The inner workings of this type of long-entrenched bug is probably byzantine and confusing even to the developers themselves, and they might be reluctant to start pulling on too many old bits of the Jenga tower. So I think that we're probably stuck with these sorts of bugs, and we just need to make it a habit to not manipulate the same object in fastloops as in the events that called the fastloops. It's probably best to put fastloops in separate events whenever there's any doubt.

    Sheesh, I really need to get back to work

  6. #6
    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,243
    Mentioned
    87 Post(s)
    Tagged
    0 Thread(s)
    Oops, I kept referring to shaku88 when I should have been saying DavidT. I got my threads mixed up

Similar Threads

  1. Replies: 3
    Last Post: 31st January 2017, 09:26 PM
  2. looped & tiled procedural animation in background?
    By Volnaiskra in forum Fusion 2.5
    Replies: 6
    Last Post: 25th September 2014, 05:13 AM
  3. Bug : Back button event is looped after one press
    By waw_demmon in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 4th April 2013, 10:28 PM
  4. [BUG] BETA 30: Looped sound overlapping itself every MMF loop
    By DistantJ in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 28th May 2012, 08:58 AM
  5. Looped Sound doesn't pause
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 27th April 2012, 11:20 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
  •