Pathfinding Issue

Get help using Construct 2

Post » Tue Apr 23, 2013 4:50 am

Hello,

I'm working up a game built off of the pathfinding demo. When creating a new level I duplicate level 1 and work up a new map, enemies, etc. I have a text object on Layout 1 that once clicked takes the player to the next level. The pathfinding breaks when the new level is loaded.

I've tested on the pathfinding demo itself and the same problem occurs. I simply duplicated Layout 1 to create Layout 2 and changed nothing else. I then placed a text object on layout 1 so that when clicked it loads layout 2. When layout 2 loads the pathfinding is broken.

If I load my level 2 directly it runs fine. If I tweak my code to load level 2 directly from the welcome screen it works fine also. The pathfinding only breaks if a previous level with pathfinding has been loaded.

Any ideas?
B
8
S
1
Posts: 38
Reputation: 1,183

Post » Tue Apr 23, 2013 11:10 am

OK, after much searching and little sleep I think I'm getting close. It looks like I need to implement the "Regenerate Obstacle Map" action since I have a second level with new paths and obstacles, correct? I'm just not sure quite how to do that.

If, like in my example above, I were to duplicate Layout 1 of the pathfinding demo that comes with Construct 2 and create "Layout 2", where would I need to add the Regenerate Obstacle Map action?

Of course I could be way off base. From what I've been able to find the regenerate obstacle map is needed when a new obstacle is placed on the playing field. My second level does have a new obstacle (wall) layout but it's already set and in place when the player enters the level. The player does not add any new obstacles themselves.

*UPDATE* No luck. Regenerate obstacle map does not appear to be the solution. Back to square 1. Testing on the Turret Defense template that comes with Construct yields no successful results.

I'm at the mercy of the fine gentlemen and ladies of the forum to help show me the light.

Thanks in advance for any help.jbarker2812013-04-23 13:23:17
B
8
S
1
Posts: 38
Reputation: 1,183


Return to How do I....?

Who is online

Users browsing this forum: abdalghani and 22 guests