User Tag List

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

Thread: Counting how many collisions at the same time (for you coding wizards out there)

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

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

    Counting how many collisions at the same time (for you coding wizards out there)

    Hello, masters of the event editor.
    This thread is to ask your support: I'd need to count how many objects of the same type are colliding together at the same time (please see linked image)

    https://www.dropbox.com/s/vtqsaauqyc...%20CT.png?dl=0


    The objects are not in a grid, so they could be just colliding from any angle.

    Thanks in advance for your wise advice!

  2. #2
    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
    170
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    This *should* work - it's a counter that sets to 0 at the start of every frame, and then runs a loop every time an object ovelaps with itself

    overlap test.jpg


    And a sample MFA
    overlap test.mfa

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Do you want to know how many collision "groups" are occurring (ie how many unique clusters of overlaps occurred)? Or how many objects collided with other objects (ie each collision from the perspective of each object's point of view)? It might be more helpful to know your intentions for all of this as well.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jun 2006
    Posts
    173
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    This *should* work - it's a counter that sets to 0 at the start of every frame, and then runs a loop every time an object ovelaps with itself
    seems to be working pretty fine, thank you!!!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jun 2006
    Posts
    173
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    Do you want to know how many collision "groups" are occurring (ie how many unique clusters of overlaps occurred)? Or how many objects collided with other objects (ie each collision from the perspective of each object's point of view)? It might be more helpful to know your intentions for all of this as well.
    Basically, the objects should destroy themselves when they are in a cluster of like 5 of them colliding together.
    Hope I made it more clear

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS 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)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    105
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Bit of a rough explaination how I might do it

    If they are all same size circles you could compare the distance between each object
    if distance is equal to diameter add fixed id to a list
    If list no of items = 5
    Destroy objects in list

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS 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)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    105
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Actually scrap that it would only work if they were all touching the same circle

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS 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)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    105
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Could work testing them sequencially horizontal though

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,421
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Here's a new take it's probably more accurate, as the counter is fighting being set to zero all the time

    overlap test 2.mfa

  10. #10
    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
    170
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aenever View Post
    Here's a new take it's probably more accurate, as the counter is fighting being set to zero all the time

    overlap test 2.mfa
    The 'fighting' the reset to 0 every frame tick shouldn't be an issue - as long as all the events that rely on the total number of collisions happens in the event list *after* those events though, not before.

    Your version does a neat job of showing how many collisions have happened overall, but if any of those objects move away from one another (so that they're no longer touching) then the counter has the wrong number of objects overlapping shown. I guess it depends on if you wanna see all the collisions in real time or like a "log" of past collisions

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Problem using 2 chars with collisions and a movable box at the same time
    By Matriax in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th January 2013, 08:40 AM
  2. Counting Fun
    By Jakinbandw in forum File Archive
    Replies: 3
    Last Post: 17th January 2009, 12:05 AM
  3. Counting exact number of collisions
    By Sarah in forum File Archive
    Replies: 0
    Last Post: 13th July 2007, 07:49 PM
  4. Counting how many...
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th October 2006, 09:36 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
  •