Tiled 1.5 lua export embedded tileset

SOLVED, not a bug.

« Hi, since i installed Tiled 1.5, when i export tiled maps as lua files, there’s only 3 tileset properties left into the map’s lua table when i export. Tileset name, firstgid and filename are there but any other property is missing like image path, imagewidth… »

tiled_bug

Fix: check embed tileset on new tileset creation or press the embed tileset button in tileset settings.
It will include tileset properties into the lua map file that it belongs to.

It sounds like you’re expecting an embedded tileset, but getting an external one. I’m not familiar with the Lua plugin myself, but have you tried embedding the tileset in Tiled and exporting that? It’s possible Tiled used to always embed the tileset for Lua exports, but now only does so if you actually want it to.

FWIW, it’s usually a good idea to use external tilesets like this, instead of duplicating the tileset data across your maps.

1 Like

Thank you eishiya, you answered my question,
My bad, i thought it was a bug.
I just embedded the tileset as you said and voila, the tileset properties were added to the lua map file and all is working fine now :wink:

As @eishiya mentioned, you’ll probably want to avoid actually embedding the tileset permanently, at least if it is used by multiple maps. Instead, you can enable the “Embed tilesets” export option in the preferences.

This export option was already introduced in Tiled 1.2 but so far the Lua plugin was still always embedding the tilesets on export. With Tiled 1.5, it will only do this when that option is enabled, because some people would like to avoid duplicating that data (and in case you do need it, if you export your tileset to a Lua file first, a reference to that exported file will now be written to the exported map file).

1 Like