User Tag List

Results 1 to 7 of 7

Thread: Is it possible to distinct between instances of the same type in events and actions?

  1. #1
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Is it possible to distinct between instances of the same type in events and actions?

    You see, there is a quarantine because of COVID-19 so I have not much to do, so it got me thinking: is the following simple case even possible? No helper objects etc., just plain events:

    Let's say that if two instances of object A collide, you want to destroy only the one which has lower ALT VAL A than the other one, for example. There might be many instances, so it not a 1:1 problem.

    We would need to scope both objects for checking of their values, and then scope only to the one whose is lower. I could think of complex, probably overengineered solutions using loops, fixed values and lists, but maybe there is an easier way?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,362
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    This has always been one of Fusion's weaker points. There is no extremely easy solutions for it, but as you say, you can run loops and keep track of fixed id's and values that way. The best way is probably to run a ForEach loop on overlapping objects. Fusion will then only scope through the objects that are overlapping, making your work a bit easier.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    And when you need to do actions on both objects, it seems almost impossible. By that I mean a case like this:

    -When A overlaps another A, move A with the lower value X above the other A.

    Trying to solve it, just for fun, but even with ForEach seems difficult, particularly because if there are many instances, the order matters.

  4. #4
    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)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    371
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    I made an example, it shows how to run code on specific instances only, but keep in mind always to think about fusions autoscoping cases like -on collision events- etc. which is also in the example shown. Have fun
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Manuel. Frankly I am unsure how to make the scenario I described to work: let's make it simple: when two instances overlap, let's always move the one with higher Y position above the other one. (I mean Layer object action, Move object A above object B - I chose this action because it requires two instances).

  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)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    371
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Ordering instances of the same object above/below on a single layer is something i tried also in the past long time with no success, i spend now also two hours tryng it again but no luck, what i do instead always is spawn lot of layers and move objects around on them that way the ordering works. But its not always a solution of course. If you find a way to do it on a single layer let me know i want to know also

  7. #7
    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)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    371
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    But i see now the layer object has this x or y sorting (increasing/decreasing) build in, its exactly what you need for your case.

Similar Threads

  1. Events Not Executing Actions for Qualifier Groups
    By CruddyBuddy in forum Fusion 2.5
    Replies: 2
    Last Post: 15th November 2018, 04:43 PM
  2. Actions per events limited to 127 ?
    By pradeep in forum Fusion 2.5
    Replies: 2
    Last Post: 29th August 2016, 07:50 AM
  3. Unique Instances & Sub-Events
    By Ryzla in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 27th December 2013, 11:05 PM
  4. Best way to have multiple instances with platform type movement.
    By bybyblue in forum Android Export Module Version 2.0
    Replies: 6
    Last Post: 11th October 2013, 05:23 PM
  5. Timer Events/Restrict actions vs in-game counters
    By Cossin in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th June 2010, 07:07 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
  •