Pathfinding on Tilemaps?

Get help using Construct 2

Post » Mon Jan 20, 2014 12:52 pm

Hi Guys,

I'm very new so, please be kind :)

Is it possible to have pathfinding work successfully within tilemaps?

I have the following set-up, when you right click a tile it removes it so, should no longer be an obstacle but, when you left click to add a path where a tile was previously removed it doesn't work as expected. If however you click in the open area and around the orange tiles it works fine.

dropbox.com/s/i2kqd90tegxihpy/PathfindTilemaps.capx

I'm guessing it might be due to setting regenerate map but, have tried a few places with no luck.

Hope that makes sense, thanks in advance.
B
3
Posts: 6
Reputation: 187

Post » Mon Jan 20, 2014 3:34 pm

I played around with the cell size & border and have it moving around now however;

If I click on the tiles as soon as the level loads the pathfinding ignores the tiles and creates nodes over them. Probably something to do with regeneration of the map in the correct place.

If I hollow out an area by right clicking the tiles then, left click to start pathfinding it doesn't find it the first time but, if I click again it finds it.

dropbox.com/s/vp6jwl6hb6f8jvt/PathfindTilemaps2.capx
B
3
Posts: 6
Reputation: 187

Post » Mon Jan 20, 2014 9:55 pm

@LazyBassTurd, Erasing tiles from tilemap is tile based so you could use something like this.

Erase tile:
floor(mouse.X/32)
floor(mouse.Y/32)

On right mouse released cannot be triggered under mouse pressed.

Also I think it should only regenerate obstacle maps when they are modified and not every pathfind.
B
34
S
9
G
3
Posts: 517
Reputation: 5,206


Return to How do I....?

Who is online

Users browsing this forum: apalm1341, blissfulwizard and 15 guests