How do I Pathfind within distance.

Get help using Construct 2

Post » Sat Jan 02, 2016 6:46 pm

Hi guys. I am working on a top down shooter game. As a hobby mostly. I Am trying to program basic enemy ai and having a few problems. I searched the forums but cant seem to find exactly what I am looking for.

What I would like to do:

-When my character gets with a certain distance from the zombie characters. I would like them to turn and chase my character.
Alot like diablo enemies. They will wander within there parameters until the player gets within a certain range.

I have set up pathfinding. And when the layout starts the zombies will chase my character around the map. However all zombies that are on the map are chasing. And i would like it to just be zombies near by. Any help would be appreciated.

What i pretty much have
B
7
S
1
Posts: 42
Reputation: 461

Post » Sat Jan 02, 2016 7:12 pm

Seems like you aren't picking..

How are your events set up?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jan 02, 2016 7:26 pm

Pretty much what I got now it.

If zombie has line of sight to player
System Every 0.1 seconds find path to Player.X Player.Y

Zombie on pathfinding Path found - Move along path

Zombie on pathfinding Failed to find path - Find path to Player.X Player.Y


How this is working currently is the zombies wont chase until I get a certain distance. But once I get that distance all zombies chase. and they do not stop chasing even If I get far enough away
B
7
S
1
Posts: 42
Reputation: 461

Post » Sun Jan 03, 2016 12:39 am

cliipso wrote:Pretty much what I got now it.

If zombie has line of sight to player
System Every 0.1 seconds find path to Player.X Player.Y

Zombie on pathfinding Path found - Move along path

Zombie on pathfinding Failed to find path - Find path to Player.X Player.Y


How this is working currently is the zombies wont chase until I get a certain distance. But once I get that distance all zombies chase. and they do not stop chasing even If I get far enough away


Pretty much or exactly?
You have no else-events and the zombie is referenced in the event that sets the action?
No system compares and such?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 03, 2016 7:10 pm

Ok....So thats why I am here asking what to do..
B
7
S
1
Posts: 42
Reputation: 461

Post » Sun Jan 03, 2016 8:45 pm

Please share your events and/or capx to see what is going wrong..
Those events sound like they should work..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests