User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 30

Thread: [Bug?] For each object in filter condition

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall 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)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,255
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)

    [Bug?] For each object in filter condition

    Hello,
    I execute a foreach action in a filter condition (click on object) and the for each loop only on the clicked object.
    It's seem not logical the for each action must loop on all objects isn't it ?

    Please check the joined mfa.

    Thanks.
    Attached files Attached files

  2. #2
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    634
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I don't see what you mean, the .mfa works as it should.

    A for each loop is an action of the object. Any and all actions inside objects are only run for instances currently selected by the event's conditions.
    So it makes sense that the for each loop action which is located inside an object only runs for currently selected.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    863
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)
    If you want it to scope to just the active(s) that were clicked on - you have to add that in - something like this:

    * User clicks with left button on Active
    Active : Set Flag 0 on
    Start loop for each one of Active, loop name "test"



    * On each one of Active, loop name "test"
    + Active: Flag 0 is on
    Active : Set scale to 1.2 (Quality = 0)

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall 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)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,255
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I understand the logic but when you coding like this:
    If active is clicked:
    + foreach active
    For me the foreach seems to for each all active.

    Thanks.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    863
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)
    If you wanted the event to only apply to the active that was clicked you wouldn't need a For Each statement - you could just put the events in the click event.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall CreatorInstall 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)

    Join Date
    Aug 2006
    Location
    France
    Posts
    1,255
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 no I wanted to make a loop for all objects. The foreach action in my example loop juste for the clicked object.

  7. #7
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    634
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    It's very hard to understand what you mean, you keep changing what's happening in your mfa and what you actually want.

    From what I understand, this is happening in the .mfa:
    For each loop in a "User clicks object" condition only loops SELECTED objects (only one) (This is not a bug)
    What you want:
    Loop ALL objects on user click

    To loop through all objects you need to lose selection/scope.
    You can do this by running a fast loop, then running the for each loop in that instead.

    Alternative, Windows-only approach is to use Select Object, or Scope Control (my extension not yet released) to select all objects again.


    If you mean that the for each loop loops ALL objects in the .mfa, this is impossible as explained in my previous post and it's not what is happening when I test.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    759
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BartekB View Post
    A for each loop is an action of the object. Any and all actions inside objects are only run for instances currently selected by the event's conditions.
    So it makes sense that the for each loop action which is located inside an object only runs for currently selected.
    There are all implicit rules, which is per definition anti-ergonomic. It makes the engine consistent but nobody will think by writing script/code like this:
    OnClickObjectA:
    Foreach(object A in ListOfObjectA)
    {
    DoSomethingWith(A)
    }

    that it is doing

    OnClickObjectA:
    ListOfObjectA = ClickedObjectA

    Foreach(object A in ListOfObjectA)
    {
    DoSomethingWith(A)
    }

    And especially when a for loop, which should be a different way to do the same thing, is doing something completely different:

    OnClickObjectA:
    For(int i=0; i<NObjectA; i++)
    {
    DoSomethingWith(ListOfObjectA[i])

    }

    I know that it was a design choice and I prefer a design choice to be consistent over the whole engine but it is really misleading.

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Aug 2011
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its one of the issues people keep running into when using fusion. Scope scope scope. Countless tutorials and example files to explain but but still difficult to grasp. Tip when designing F3, make it more intuitive lol

  10. #10
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    634
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    If the for each loop would iterate through all objects rather than just the selected, you would not be able to choose which objects should go through the for each loop which becomes a worse feature.

    There is the following:

    Why should Set X Position only execute on the object that was clicked on, but the loop to execute for every object? It doesn't make sense.

    The following optimisation wouldn't work here either if for each loop behaved differently:


    It was most likely not a design choice, as any action within an object will automatically use objects in the currently selected list, not the all objects list like your first coding example.
    For one, I use For each loops like functions, so it would be very annoying if I had to execute the loop through every object, not just the ones I want.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Help with active object condition
    By fafikozoom in forum Fusion 2.5
    Replies: 5
    Last Post: 18th October 2016, 07:25 PM
  2. Flash object while [condition]
    By Hidronax in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th August 2016, 06:23 PM
  3. Replies: 2
    Last Post: 26th September 2015, 07:23 PM
  4. nearest object condition event
    By Lukiester in forum Fusion 2.5
    Replies: 4
    Last Post: 21st August 2015, 06:24 PM
  5. Graphics Filter, Audio Filter, and Transition SDK
    By kraminator in forum Extension Development
    Replies: 7
    Last Post: 27th March 2011, 08:40 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
  •