User Tag List

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

Thread: Target Closest Enemy or Multiple Enemies

  1. #1
    No Products Registered

    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Target Closest Enemy or Multiple Enemies

    In a lot of video games, you can target and lock on to an enemy by holding L or whatever button. I was wondering how to achieve a similar effect in a Fusion game.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    ZayLong's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    what I would do, is make an active object, make it like a circle, then make that circle invisible.

    then create an event that would test to see if that circle is overlapping an enemy as the button is held down. IF there is a cursor thats in your game you would in that same event set the x and y position to that enemy thats being overlapped by that circle.


    idk if i explained that well or not......probably not

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    For starters, you're probably going to want to give the enemies an alterable value corresponding to a "target priority".
    You might set this to just the distance of the enemy from the player, or you might use a more complicated formula - eg. A formula combining the distance and angle, so it only locks onto enemies more or less directly in front of the player.

    You could then use the "Select Object" extension to pick the enemy with the lowest alterable value, and then target it.

    If you want a more specific answer, you'll have to ask a more specific question, explaining *exactly* what you're trying to do.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    ZayLong's Avatar
    Join Date
    Jun 2008
    Location
    USA
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    Quote Originally Posted by MuddyMole
    For starters, you're probably going to want to give the enemies an alterable value corresponding to a "target priority".
    You might set this to just the distance of the enemy from the player, or you might use a more complicated formula - eg. A formula combining the distance and angle, so it only locks onto enemies more or less directly in front of the player.

    You could then use the "Select Object" extension to pick the enemy with the lowest alterable value, and then target it.

    If you want a more specific answer, you'll have to ask a more specific question, explaining *exactly* what you're trying to do.
    this sounds good also. Actually what KIND of game Is it for that matter? is it a platformer or is it a first person click/shoot?

  5. #5
    No Products Registered

    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    It's more a platform game than first person.

  6. #6
    No Products Registered

    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    Also, where is the "Select Object" extension?

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    http://sites.google.com/site/mmf2stuff/

  8. #8
    No Products Registered

    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    What I'm trying to do is have then when the player holds Shift, the character locks onto the closest enemy and then when the player presses the spacebar the character launches an object at that targeted enemy.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Target Closest Enemy or Multiple Enemies

    Here's an example: http://www.dynamicarcade.co.uk/examples/MMF2/Auto-Aim.zip



    Quote Originally Posted by MuddyMole
    For starters, you're probably going to want to give the enemies an alterable value corresponding to a "target priority".
    You might set this to just the distance of the enemy from the player, or you might use a more complicated formula - eg. A formula combining the distance and angle, so it only locks onto enemies more or less directly in front of the player.

    You could then use the "Select Object" extension to pick the enemy with the lowest alterable value, and then target it.
    Fun fact: This is almost exactly the code used for the auto-aim system I wrote for Wheelman. I also had different targets have a different built-in priority bias, among other things.

  10. #10
    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)

    Re: Target Closest Enemy or Multiple Enemies

    That's a great example, Dynasoft! I especially like how the plasma bullets don't travel in a straight line and curve towards the next target after destroying one.
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Pick the closest enemy
    By StardustSpeedman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th July 2012, 07:27 AM
  2. Only added score of single enemy when destroy multiple enemies at a time.
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th April 2012, 11:26 AM
  3. Multiple enemies
    By Blackwolfdave in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th February 2011, 01:55 PM
  4. Tower Defence "Shoot Closest Enemy" Example
    By netninja in forum File Archive
    Replies: 5
    Last Post: 28th October 2009, 01:33 AM
  5. Finding Closest Enemy example
    By TreeHugger in forum File Archive
    Replies: 1
    Last Post: 2nd February 2009, 02:35 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
  •