How do I make multiple enemies act indepedent?

0 favourites
  • 13 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • Hello, I've seen some posts about that, but I got no solution for my issue.

    I've made a "IA" for the enemies. The part of walking around like mobs and chasing the player works fine for one or multiple instances.

    The attack behavior works fine when there's only one instance that should be attacking.

    But if I put two or more, the first one to collide with player waits for the second one to attack, and they both do only one attack (like, instead of making two hits, they make only one together).

    Here's the image of the enemy attacking

    And here's the image of my script:

    Tagged:

  • For this I find it's better to drop the system conditions and use a Timer behaviour. You start the Timer on 'attacking' and then 'on timer finished' you have some actions for the enemy. This helps them work more independently and you can track it.

  • I've tried that because I've read this suggestion on another post. It didn't work...

    :(

  • Post the events using the timer behaviour and explain how or where it didn't work

  • Ok, I'll try it again and show here.

    Thanks, lionz!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi, I've tried you suggestion and a bunch of similar variations with Timers, and nothing worked.

    Look the script. What do you think?

  • This is still using system conditions and every X seconds. The timer is supposed to act as the time between attacks, not every X seconds. When I have time I will create an example.

  • Got it! I'll try it again! Thanks, and sorry for bothering

  • Is it like what you said? The mob still waiting for another to attack... :(

  • Check out this for some ideas. You drag and drop the enemy to start an attack sequence. You should avoid using system conditions including the trigger once. On your last screenshot there is no reason to set a status on collision then start a timer based on the status condition, you should just start the timer on collision, status can still be changed in the one event.

    dropbox.com/scl/fi/kr9ccbs0vwtd806gyydc6/enemytimer.c3p

  • Thanks for replying again and for sending an example.

    I still struggling with that. I see no big differences between mine and your example.

  • What is the current problem though? If they are not attacking it could be influenced by other events which are true at the same time as being set to 'attacking'

  • I'll check that possibility. Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)