User Tag List

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

Thread: How do you make an object react depending on which side another object is closer to?

  1. #1
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you make an object react depending on which side another object is closer to?

    Just for an example, in a top-down view, say you had a martial artist or a boxer as an object, and then an enemy object, or a thug or something, draws near. Say if the thug was closer to the left side of the boxer than the right side, and you want to make a boxer throw out a punch with the hand that's closer to the boxer (the left side), how would you code that?

    Sleepy at the moment so I hope this post makes sense.

  2. #2
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,461
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    I would create two or three invisible of detection zones around the boxer. Next create events based on what happens if a thug enters a zone.

    Think of being in fight. Punches or kicks you use are based on how far away the enemy is. If they are just in the largest zone you might use a kick but you will not use a upper cut.


    I hope some day actives will have detection zones as a property option. This issue seems to come up a lot.

  3. #3
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 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
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    markers are easiest, or you could do loops on the enemies distance to player and determine that way.

  4. #4
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,461
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    danjo:

    What are markers?

  5. #5
    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,419
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I think what danjo means is a defined zone, that could determined by actives set out as distance markers. The markers could be positioned to the enemy boxer and if the player is overlapping the markers certain actions would be possible.

  6. #6
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I already have loops set up in some regard. Unfortunately I'm trying to avoid having extra objects in the scene since I already have a ton.

    How would you go about writing out the code/ math about a thug enemy being closer to the left side of the boxer than the right?

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Christian_Wheel's Avatar
    Join Date
    Mar 2010
    Location
    Los Angeles
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If X Position of Thug is < X Position of Boxer, Thug is on the left. If X Position of Thug is => X Position of Boxer, he's on the right. You can put the equality condition on either side you want, just make sure you handle it.

  8. #8
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only problem with this is that the thug can also rotate. So if he's turned completely around/ 180 degrees, then the X position checks won't work right.

  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,419
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    It would still work if you put in a condition that checks if the thug has rotated 180 and then inverse Christian’s suggestion. If you need more help, I suggest you put up a simplified mfa file.

  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
    622
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    From what I understood, you wanted this sort of thing? BoxerThugExample.mfa

    Basically you get two angles: Player's current and angle from player to thug, then you compare them together to find out whether the left or right side is closer.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 7th December 2017, 02:35 AM
  2. Replies: 12
    Last Post: 22nd May 2017, 07:59 PM
  3. Replies: 1
    Last Post: 22nd March 2016, 11:11 AM
  4. [Possible Bug] FastLoops with a side of Object Ordering
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 25th June 2012, 12:50 PM
  5. Changing volume depending on distance to object?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 3rd February 2012, 01:04 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
  •