User Tag List

Results 1 to 4 of 4

Thread: Multiple Enemy AI behavior

  1. #1
    Clicker Fusion 2.5Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2014
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Multiple Enemy AI behavior

    Hey guys, I'm really stuck on my project. What I have is a 4 piece enemy. The enemy has a collision mask, a bottom sprite (legs if you will) and a top sprite (the head) and then a fire object that positions itself at the head. The reason why I went with this route is to let the top always look at the player and the fire object will also look in the same direction as the head. It's quite a simple enemy with 'Goomba" behavior. I also have made an enemy sight firing range that works when the player is overlapping it, the enemy will change animations and attack the player.

    So my problem is whenever I want the enemy to attack the player, ever single enemy sees and attacks. I followed a neat little tutorial by the MeadowHare on youtube (ThatGuyOverThere) and he helped me get the movement foundation down.

    I have tried many methods, but no matter what I do every enemy attacks. I have it to always my spread the value of its ID and then to start a loop to the number of its objects times (Not on the same condition)

    I have it set up this way for the Attacking Group

    >On loop "EnSinkMask"
    ID of "SinkMask" = LoopIndex(EnSinkMask")
    Player is overlapping Firing range
    >> Start new loop "EnSinkAtck" 1 time (I only want him to attack once and then have a bit of a cool down)

    > On loop "EnSinkAtck"
    ID of "SinkMask" = LoopIndex(EnSinkMask")
    >> Change animation sequence to Launching and look at the player,
    Make both the head piece and fire invisible (The reason why, the legs have an animation for launching)

    > On loop "EnSinkAtck"
    ID of "SinkMask" = LoopIndex(EnSinkMask")
    Animation Launching is over
    >> Stop loop "EnSinkAtck"
    Restore animation sequence of the bottom
    Make both head and fire object visible again

    I don't understand it, shouldn't the spread ID and equaling the ID of the enemy to the loop's index logically separate all enemies? I want only ONE to attack the player if the player is seen, not all of them x.x If anyone can help me, it would greatly be appreciated! (I am not using any extensions, all of this is custom engine).

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    For starters, stop using the fastloops, and start using ForEach loops (as you are using MMF2, you may need to hunt down the ForEach object if you want to use them, which I highly recommend you do), it will greatly improve performance when you have a lot of enemies at once and it's a lot more reliable for what you're trying to do.

  3. #3
    Clicker Fusion 2.5Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Feb 2014
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much for replying! I managed to solve it with the help of Schrodinger

    I'm still learning how to properly implement the foreach object. I have many objects I'd like to duplicate and behave separately. Any good examples to practice on? I'm using the MMF2, so CTF 2.5 mfas won't work for me :c

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I noticed you were using MMF2. Fortunately the ForEach object is basically the same thing as the built-in ForEach loops of CF2.5, so you don't have to worry too much about that (otherwise I probably wouldn't have recommended you use it). I think the ForEach object comes with several examples, they might be able to help you out some.

Similar Threads

  1. Multiple Enemy AI behavior
    By XeinR in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 3rd August 2015, 03:42 PM
  2. Repeatable enemy turret behavior
    By CPOKashue in forum Fusion 2.5
    Replies: 6
    Last Post: 11th February 2015, 07:02 PM
  3. Multiple enemy's with sensors.
    By Jase in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th September 2010, 12:26 AM
  4. multiple enemy healthbar help
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd November 2008, 02:44 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
  •