User Tag List

Results 1 to 3 of 3

Thread: Help! Tower Defence Turrets Always Focusing Newest Enemy Problem!

  1. #1
    Clicker 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)
    TheKruk666's Avatar
    Join Date
    Aug 2016
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Help! Tower Defence Turrets Always Focusing Newest Enemy Problem!

    Hi. At the start I want to apologize for my bad english. But to the point.

    I wanted to make a tower defense type game. And everything was going fine except for one small detail. When there are multiple enemies within the turret range, they always focus on the "newest" enemy. So the "older" which is furher on the path, can often get away. You can see this on this video:
    https://www.youtube.com/watch?v=z42ilO3M7W0

    After some digging in the Internet I found an Object Extension, which should allow to select the object with the highest alterable value, but it either crashing game or doesn't work at all.

    My question is. Can I make these turrets shoot the enemy in range that is further on the path? Or for example shoot the enemy with the highest alterable value, that would be nice. Maybe I can do it in fast loops, but unfortunately I do not know how to use them. Can you help me?
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export Module
    Emerson3's Avatar
    Join Date
    Apr 2014
    Location
    Lafayette, Louisiana
    Posts
    721
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey TheKruk666,

    From the video, I think the focus is not on the order of created actives, but on the distance to each turret. I can't open mfa so I may be wrong. In your mfa, there should be a way to tweak the distance that each gun will continue to fire upon each enemy. Hope this makes sense. Will open and check when I get home. Someone will prob have already answered your question though! Good luck!

  3. #3
    No Products Registered

    Join Date
    Jun 2011
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am only posting this feeble attempt; since no-one really gave an answer so far - this is by no means optimised or 100%

    I am simply giving an idea to play with. (This is targeting the highest health)

    The example I made use Max to get the highest value of six spawned objects. (perhaps there is a better way - but you will need to have the highest health of one of the objects)
    It spawns 6 objects in and gives them random health. I spread the values for the objects o alt. value B
    When all is spawned in, the max number for the health is determined and placed in a counter.
    If that counter is = to one of the objects health, it will at least attempt to shoot in its direction.
    If there are more than one with the same health it should pick only one of them at random.
    The health is deducted when a bullet hits the object and is destroyed when reaching 0 at which point another object is spawned in again.

    I guess the same principal will apply for distance but using Pythagoras -
    Sqr((X( "ghost" )-X( "player" ))*(X( "ghost" )-X( "player" ))+(Y( "ghost" )-Y( "player" ))*(Y( "ghost" )-Y( "player" ))) <=150

    A 150 pixel radius around the ghost.

    This can be tweaked as desired.

    Hope it helps.
    Attached files Attached files

Similar Threads

  1. Tower Defence Kit 1.0
    By SolarB in forum Guides, Tutorials, Examples, Widgets
    Replies: 3
    Last Post: 2nd September 2014, 04:20 AM
  2. Tower Defence Help
    By Destroyer0203 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 1st January 2010, 12:33 AM
  3. Tower Defence "Shoot Closest Enemy" Example
    By netninja in forum File Archive
    Replies: 5
    Last Post: 28th October 2009, 01:33 AM
  4. Tower defence
    By Algul in forum File Archive
    Replies: 14
    Last Post: 1st June 2009, 12:22 PM
  5. Tower defence Range
    By Zmaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 19th October 2008, 08:01 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
  •