User Tag List

Results 1 to 6 of 6

Thread: Making enemy triggering independent?

  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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making enemy triggering independent?

    I have this code, actually every monster has a radius with him ( same id following etc) with this code monsters find the closest player and follow him (they switch target when other player is closer), problem is when I overlap any radius every monster start to follow that player instead of keep independent, how can i referenciate just the only one i'm overlaping?

    followtarget.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Perhaps a ForEach function, if you just want to have one enemy to follow?

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Changed some bits here and there, better using a single object value for the pick nearest calculations
    (I generally keep a single object values, used as "engine" of the game for making this kind of things)
    now enemies will get "flag 0 ON" when there's somebody in range:

    followtarget_1.mfa

  4. #4
    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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    Changed some bits here and there, better using a single object value for the pick nearest calculations
    (I generally keep a single object values, used as "engine" of the game for making this kind of things)
    now enemies will get "flag 0 ON" when there's somebody in range:

    followtarget_1.mfa
    that's exactly what i was looking for, thanks!
    Now looking at code I want to fully understand what does and lean it, there are some things i dont understand at all:
    - Why u set the pick instance to an engine, isnt this value changing all the time?
    - Why u set on always a flag to off and then switch it on ? it's to recalculate the nearst object every second? flags work individualy for an object or all at the same time?

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's useful to use a separate active object as a container to hold all your extra alterable values and strings. Therefore you don't have to mess with the internal zombie values and instances if it's a variable that doesn't have to deal with that. He's recording the current chosen zombie's fixed value that was overlapped with the player group. He needs to do this or else the object will lose scope between the two different foreach loops for "pick_nearest" and "find_nearest" for the players (line 7 & 8). Since it's a nested foreach loop, it will go through each zombie that was overlapping the player, and test that one specifically versus all the players.

    Always setting the internal flag 0 off will set it off for all the zombies since a specific one isn't selected. He does this before his foreach loop so it resets all of their internal flag 0's to off. Then when he goes through the foreach loop, setting the internal flag 0 to on will select the zombies that are overlapping players only. Therefore when he does his second foreach loop "find_nearest", it will only target the zombies that were overlapping with the player.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    That's it, thanks Sumo

Similar Threads

  1. Replies: 2
    Last Post: 29th September 2016, 04:12 PM
  2. need help making Enemy Jump
    By Circus_Potato in forum Fusion 2.5
    Replies: 5
    Last Post: 20th August 2015, 01:52 PM
  3. Making an arrow stick to an enemy
    By DTownTony in forum Fusion 2.5
    Replies: 4
    Last Post: 17th March 2014, 12:56 PM
  4. Making unchanging enemy id's
    By LazyCoder in forum File Archive
    Replies: 4
    Last Post: 24th September 2006, 05:36 AM
  5. Making an enemy drop-rate
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th August 2006, 05:53 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
  •