Path finding plus new solids

Discussion and feedback on Construct 2

Post » Thu Jan 02, 2014 11:30 am

I read that adding new obstacles after a layout loads requires recalcing the obstacle map. I thought this meant that paths would just be calced incorrectly until the map gets regenerated.

Is it also true that when adding new obstacles that are solids and telling a sprite to follow a path using the old obstacle map that the sprites just ignore the new solids and walk right through them?

I was trying to have my map get calced with its obstacles at startup and then adding destructible walls on a timer (once) after the layout loads so that once those destructible walls are destroyed the enemies could walk through the space they once occupied... but the enemies pretend they are not there at all and just walk through them before they are destroyed.

It is as if the solid behavior has no real effect on sprites that are "following a path".
B
21
S
5
Posts: 195
Reputation: 1,972

Post » Thu Jan 02, 2014 5:34 pm

You should rebuild and recalculate a path.

Once the path is calculated it is built into the pathfinder node list. Adding objects won't auto recalculate anything. So it will move through the solids.

You will probably need to tweak things a little to get them to work right. As a suggestion. Reubuild the path map(not the path) the tick after all the objects are built.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests