Pathfinding goes right through solids as if it wasn't there

Get help using Construct 2

Post » Fri Nov 07, 2014 11:09 am

ScreenHunter_829 Nov. 07 06.04.jpg
Hi, so I'm making a TD game and I want the enemy sprite to move through a maze generated by the user.
Problem is, is that the pathfinder doesn't work at all. Not only doesn't it find a path, the sprite also goes right through all solids.

Yes, the enemy and the solid "walls" made of turrets are both solids.
The path finder just totally ignores the solid.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 17
Reputation: 234

Post » Fri Nov 07, 2014 11:11 am

Here's the properties
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 17
Reputation: 234

Post » Fri Nov 07, 2014 11:12 am

And the other since it won't let me upload more than 1 pic at a time
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 17
Reputation: 234

Post » Fri Nov 07, 2014 9:35 pm

actually to be more specific,

The enemy ONLY goes through Spawned versions of the turret, but the origional turret behaves correctly (it treats it like a solid and avoids it).
Why is it that it is only going through the spawned turrets? I thought the spawned turrets inheret the properties of the origional.
B
4
Posts: 17
Reputation: 234

Post » Fri Nov 07, 2014 10:18 pm

I'm guessing you haven't recalculated the path finding map (regenerate obstacle map) after a new turret has been spawned/placed.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Nov 07, 2014 11:39 pm

Hi thanks so much for responding,

Yes after testing each possible variable, after like 5 hours I figured out that the enemies were moving to the conditions set at the start of the map regardless of what solids were moved/spawned around afterwards

I was looking for could reset this "initial condition" but I couldn't find it.
Thanks for telling me.

My next problem is that I don't have "Regenerate obstacle map" as an action.

What I do is:
I click on action -> look at Layers&Layouts-> *But I don't see regenerate obstable map anywhere.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 17
Reputation: 234

Post » Sat Nov 08, 2014 9:51 am

The "regenerate obstacle map" action is under the object that has the "pathfinding behaviour". So if your object that has "pathfinding behaviour" is "enemy" double click it and scroll down until you find the "pathfinding" sub-heading.

regenobstaclemap.png


You'll probably need to put this action in the event for adding a new turret to the map.
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Sat Nov 08, 2014 9:37 pm

Got it thanks so much!
Now I'm going to try to add multiplayer features with a Lobby and everything for an online 1 vs 1 turret defense game.
But....I'm looking at rexrainbow's smaple code andd wow it looks diffiicult!
B
4
Posts: 17
Reputation: 234

Post » Sun Nov 09, 2014 3:11 am

Even better, if you're regenerating the map every time an object is created there is an action to only regenerate the region around that object. You'll avoid a lot of unnecessary happenings this way.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests