User Tag List

Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 45

Thread: best way of comparing values and testing overlapping objects?

  1. #1
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    best way of comparing values and testing overlapping objects?

    I have hitboxes with ID's set to be positioned accordingly to other objects and I want to trigger a sound when one overlaps another and their ID's are different and a specific animation is playing. what I setup seems to work but sometimes the game will randomly effect all of them on screen at the same time including the ID of the object it was checking for being different. ordering the events differently for the few things it is checking seems to change everything, one order slows the framerate down a lot for some odd reason. what is the best way I can test an overlap and make a comparison between the two objects and their values without using fast loops or resulting in a major slowdown?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you be more specific about what you are trying to do?

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Why do you first need to check if their IDs (no apostrophe) are different? Objects don't collide with themselves. Checking if their IDs are different for the same type of object is tricky...
    Working as fast as I can on Fusion 3

  4. #4
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    Why do you first need to check if their IDs (no apostrophe) are different? Objects don't collide with themselves. Checking if their IDs are different for the same type of object is tricky...
    all the players on screen have two actives acting as hitboxes on screen. one is for checking collisions with the other which is for attacks. since the attack hitbox is constantly overlapping the damage hitbox i don't want it to react if the ID matches between the two objects.

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ah, you're using the multi-object detector system. This system works, but as you are seeing it is difficult to work with in situations like this.

    The current popular detector system is having detectors inbuilt to the object - In your events, you would store the current animation and animation frame, change the animations and frames to hitbox animations, do collision checks, then change the animations and frames back to the ones that you saved in the alterable values. This means each object only needs itself to work properly and is completely self-contained. You don't even need IDs. The only downside is that you may have to manually animate your actives if they won't animate correctly, it is a lot easier than having multiple objects for each object. (I object to the multi-object method )
    Working as fast as I can on Fusion 3

  6. #6
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    Ah, you're using the multi-object detector system. This system works, but as you are seeing it is difficult to work with in situations like this.

    The current popular detector system is having detectors inbuilt to the object - In your events, you would store the current animation and animation frame, change the animations and frames to hitbox animations, do collision checks, then change the animations and frames back to the ones that you saved in the alterable values. This means each object only needs itself to work properly and is completely self-contained. You don't even need IDs. The only downside is that you may have to manually animate your actives if they won't animate correctly, it is a lot easier than having multiple objects for each object. (I object to the multi-object method )
    the IDs are being used for plenty more than this, the animation frame, the animation value, and the direction are all set to match the visible sprite's details. if I stored all of that in values how would that exactly fix my issue though with overlap detection?

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Matching and telling apart matched objects is really tricky in MMF2. The idea is to avoid it altogether by doing everything in one object.
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This shouldnt be hard at all.
    It is even possible to have Collisiion Box Detector and Attack Detector in the same Object, wich makes everything less complicated.

    Brawltaunts22, if you would be so kind as to post the .mfa you are working on ( or a entirely different Application illustrating the same problem ), ill be more than happy to take a look at it and show you the best solution.

  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The thing that is complicated, is re-writing your code to use the new system and depending on how you coded it the first time, this could be difficult...

    Best of luck comrade. It's worth it.

  10. #10
    No Products Registered

    Join Date
    Dec 2010
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sort of managed to fix the issue except now comes the second portion of the problem. it is able to recognize the event properly now but i am trying to set a value on the hitbox that is being overlapped. the value is set properly sometimes but half the time it is set to a different hitbox.

Page 1 of 5 1 2 3 ... LastLast

Similar Threads

  1. comparing values on overlap
    By itsa_doozy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th March 2013, 06:19 PM
  2. PROBLEM COMPARING FLOATING VALUES
    By Fernando in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th August 2011, 08:12 PM
  3. [BUG] PROBLEM COMPARING FLOATING VALUES
    By Fernando in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 6th August 2011, 05:40 PM
  4. Checking and comparing values of an object.
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th May 2009, 10:47 PM
  5. Comparing 2 global values question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th January 2009, 04:23 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
  •