How do I get my enemies to change target after destroyed

Get help using Construct 2

Post » Tue Oct 14, 2014 11:41 pm

Greetings all.

I am working on getting my zombies to attack multiple turrets. Once a turret is destroyed, I want them to attack another turret that is still active.
Currently, with the pathing behavior, they will choose different turrets, which is fine at the begining. But once the current target they have selected is destroyed, they don't move on to the other target. Additionally, the ones that were attacking the other active turret, stop attacking it.
I have the following line in my events:

Turret [On Destroyed] > Zombie [Find path to Turret.X,Turret.Y]

Currently, I have added an "On Touch" option to re-acquire the turret using the exact same code (without the "on destroyed") and that part works fine. I click the button and they go for the turret that is still alive.

Attached is my example file (please excuse the horrible graphics... still working on concept)

I appreciate any help to clear this up. Im sure its something simple, but I have been screwing with this simple bug longer than I should have.
Thanks
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 177

Post » Wed Oct 15, 2014 12:51 am

@Xarddrax I am not a computer to be able to open the CAPX but without looking at it I would add a line of sight event. That could be a simple fix.

If zombie has line of sight to turret then zombie will find path to turret
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Wed Oct 15, 2014 1:16 pm

Would this work?
You do not have the required permissions to view the files attached to this post.
B
34
S
9
G
3
Posts: 517
Reputation: 5,246

Post » Wed Oct 15, 2014 3:12 pm

@xarddrax fixed the shooting too so they only shoot when zombies are in line of sight.
You do not have the required permissions to view the files attached to this post.
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Wed Oct 15, 2014 7:27 pm

Brilliant! Thanks @Katalaa and @robertjs3! Exactly what I was trying to do.
B
3
Posts: 2
Reputation: 177


Return to How do I....?

Who is online

Users browsing this forum: jezjones24, Lancifer, newt, R0J0hound and 22 guests