Tiled fails to open maps with embedded tilesets

Hello,

I tried to open the map I was working on yesterday and I received this message:
tiled_2018-03-01_09-58-57

I open the tmx file with a text editor and I replaced the embedded tilesets with the actual tileset files:

 <tileset firstgid="1" source="holes_tileset.tsx"/>
 <tileset firstgid="19" source="walls_tileset.tsx"/>

and now, Tiled succeeds to open the map.

To check whether it was just a problem of file corruption, I made a new map (empty) and I embedded my tilesets to it, save it, close the file and open it. This leads to the same crash and same error message.

What is funny is that if I export the map in json before to close it, the json map work perfectly in Phaser.

Any idea of what is going on?

This means there may be some inconsistency in the map reader and writer, or between the data and the verification checks done in the map reader. The error messages pops up if this check fails:

It would be very helpful if you could upload the files you’re using to reproduce the problem (see the Upload button in the post tool bar).

Hello bjorn,

here is the file, with the embedded tilesets.
map2-embedded.tmx (13.4 KB)

Hope that will help you :slight_smile: Sorry for the slow answer.

No problem, that really helped! Indeed the file was invalid and I found out how this happened. When you embed a tileset, it is internally cloned to avoid affecting the external tileset with further edits, but the cloning of Wang sets was incomplete. I fixed it in the following change:

It will be included in a future Tiled 1.1.4 release and the next development snapshot.