Can we Import Lua exports?

If I export as lua is there a way to import as lua? My game is in lua so it just makes sense to export as lua to make reading the map info easier (no parsing xml). However my game allows the map to be modified by the player (online game). So I will be modifying the lua table that is returned from the lua file export and writing it back to file when saving it, but if I want to see the result of the map in Tiled (to get an overview of what the players did and possibly make modifications if needed from Tiled) would there be a way to do this? I’m not seeing any Import options and the Open dialog doesn’t show lua files.

Thanks!

Sorry, for loading a map back you will have to write it out to a JSON or XML (TMX) file. For loading back the actual Lua file, Tiled would have to either know how to parse a Lua table or embed a Lua interpreter, which it currently does not. It would however definitely be an option to implement in the future.

Since you’ll have to serialize the Lua table into a file anyway, I think the easiest for you would be to write it out in JSON format when you want to load it back into Tiled.

1 Like