Tile-set behaves different in 2 TMX files


(Frank) #1

Hi

I use Tiled for my tile-maps and use Tiled2Unity to get it all in Unity.

I have 5 tile-sets and each one is used for 10 levels in the game.

In the .tmx file there is a Tile layer called ‘collision’ and all the Platforms that can be walked on and the walls that define where the player can walk are on this layer.

When I play one level its all fine, but when I play say level 6 and the game starts, the player just drop through the tiles and off the screen.

I’ve been told to edit the tile-set in Tiled Collision Editor for each platform / wall tile.

Is this correct / the only way / best way ?

If I do need to do it - or if it is indeed the best practice, is it possible to edit 1 version of the Tile-set and then copy that into existing - already build, levels ?

I’m aware you can export a tile-set - and this then creates a .tsx file, but I don’t know if that can be then used / imported into a different level ( .tmx file ) and that it will inherit the Collision data and work straight away on a level that is already defined.

Really appreciate some help

Thanks
Frank


(Thorbjørn Lindeijer) #2

If you’re using embedded tilesets then indeed you’d need to add the collision information to each such tileset. This is why since Tiled 1.0, tilesets are saved as stand-alone files by default.

If you already made your level with an embedded copy of the tileset, then there is currently unfortunately no straight-forward way in Tiled to replace it with the external tileset. However, it is easy to do this using a text editor. Just look up the external tileset reference in a map that does use the external tileset (after exporting it, for example) and then replace the full embedded <tileset> element with this external tileset reference, taking care to keep the original “firstgid” value.


(Frank) #3

Hi Bjorn

Thanks for the reply. I still need some help / answers as I made most of my levels a long time ago and I don’t understand the difference between “embedded and external”.

I also don’t recall seeing the “Embed in Map” option when I added the tilesets. All of my levels are created using a Tileset with a .png suffix.

If I open Level 1 and edit the collision data to the platform and wall tiles, how do I get those changes into the other levels that use the same Tileset ?

Many thanks


(Frank) #4

Hi All

In my level 1, I’ve edited the Tileset and added collision to some of the tiles. I’ve then exported the Tileset and changed the reference in the other tmx files that use the same Tileset so it points to the exported file.

This solves the issue I had of the player dropping off the screen on some levels, which is great.

I need to add collision to another tile and wanted to check how I do that ? Level 1 only shows the new exported Tileset - do I edit that and re-export ?

Where can I see which tiles have already been amended to include collusion ? I can’t see anywhere that it shows a tile has been amended ? Or am I missing something?

Thanks in advance for your help

Cheers
Frank