Multiple Enemies toward Player with Pathfinding

Chat about anything not covered in these forums, but keep it civil!

Post » Tue Nov 12, 2013 3:35 am

Hi everyone,

*** Before, let me thank everyone on the forum who post questions, answers and help others. Sincerely, Thank you, I would have never achieved what I succeeded doing until now and I hope to get your knowledge in the near future to help others as well.***

- The capx allows you to see how the Player moves toward Mouse clic with Pathfinding
- How an enemy detects the Player and chases him with Pathfinding
- On Attack Range, how the enemy triggers his attack animation
- If the Player manages to escape, the enemy returns to its position

Here is my problem. I would like to create multiple enemies (same sprite and behavior) who have their own position on the map. When the Player gets into their range, only the enemy who detects the Player needs to chase him. If the Player manages to run outside of the detection range, the enemy returns to his initial position. So, it works for one but not for multiple enemies.

How can I post the capx from dropbox?
if I paste the link, it does not work, because of security spam








    1. null
    B
    26
    S
    10
    G
    3
    Posts: 72
    Reputation: 4,008

    Post » Wed Nov 13, 2013 12:28 am

    Maybe you should re-post this in the 'How do I .... "
    section of the forum.
    B
    36
    S
    10
    G
    4
    Posts: 250
    Reputation: 7,963

    Post » Wed Nov 13, 2013 1:12 am

    Thank you producermark11
    B
    26
    S
    10
    G
    3
    Posts: 72
    Reputation: 4,008

    Post » Wed Nov 13, 2013 7:51 pm

    @underdog I think this is a case of using - or not using - "for each" enemy in the events. When you post the capx I'm quite sure it will easily be solved.
    B
    18
    S
    4
    G
    1
    Posts: 332
    Reputation: 3,149

    Post » Thu Nov 14, 2013 10:03 am

    Hi Windwalker,
    Thanks for the tip. I also tried it but it seems that I have an issue with the "For Each" event for this behavior. I'm pretty sure that once I will get my Construct 2 licence (soon), "Family" will fix my problem or there is probably something I did not get lol

    I also think to change my Detection behavior with the Turret/Line of sight behavior and checking distance. And, having an array to check if enemies are not overlapping. If they do, move to another closest free "array cell" from the Player. What do you think? Is this a good approach or do we have something easier?

    However, I post the capx in the HowTo Forum. Still can't post the any link on the forum yet but I "cheat" it to post it. Sorry, it's a bit odd.
    B
    26
    S
    10
    G
    3
    Posts: 72
    Reputation: 4,008


    Return to Open Topic

    Who is online

    Users browsing this forum: Shasta Sanonte, sleepyryan and 3 guests