How do I reset the pathfinding?

Just started using Construct 2? Post your questions here

Post » Sun Nov 01, 2015 2:33 pm

Hi guys,

I'm working on a turret defense game. I want the player to be able to drag&drop the walls between the rounds.

My problem is, that once a path is set, the enemys wont change it and walk though the walls I moved into their way and ignore the new and shorter path.

I would be very thankful for any tipps or maybe even a small example.

Thanks and so long
B
3
Posts: 7
Reputation: 189

Post » Sun Nov 01, 2015 2:53 pm

Ozymandiaz wrote:Hi guys,

I'm working on a turret defense game. I want the player to be able to drag&drop the walls between the rounds.

My problem is, that once a path is set, the enemys wont change it and walk though the walls I moved into their way and ignore the new and shorter path.

I would be very thankful for any tipps or maybe even a small example.

Thanks and so long


Quote from the Manual:

Regenerate obstacle map
Determine whether each cell in the obstacles grid is an obstacle again. This is a very CPU intensive action and should not be used regularly. If only part of the obstacle map has changed, prefer to use one of the Regenerate region actions. Any changes made by using Add obstacle, Clear obstacles, Add path cost and Clear cost will take effect the next tick after this action. Note this means if you attempt to find a path immediately after this action, the obstacle map won't have been updated yet; add a 'Wait' action with a short delay to make sure the updated map is used in that case.


Will this help?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,489
Reputation: 59,764


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests