Using Lua files from Tiled (SOLVED)

Hello there!
I’ve been searching the Defold’s forum methods to import maps using Tiled. I used the plugin* that exports .tilemap and I ‘finished’ my first game using them. Pretty nice! But I want to extract more from Tiled and maybe use lua files to build the tilemap + place game objects ( + collision idk).

I found some old (+ 2 years) threads with examples using .json (and some too complex). There’s new simple examples out there using .lua?

Thank you!

4 Likes

Tiled can export to lua. You can look inside it. It is easy to understand format.

1)You can export all to lua, and create defold tilemap in runtime,using info from that file.
2)Or you can export to defold files to make tilemap. And then export to lua file, and then take all you need from lua file.

3)I can tell you my way of working with tiled.
I use tiled as a level editor for my game. I export to lua. Then I convert this files to my own json format.
I need that convert, because tiled lua format contains a lot of information that I don’t need.Also I need to make validation, some level optimizations, and some fixes(fixed order of tilesets used in level,…).And some other stuff.
It is the most hard way, but it give me a lot of power.
https://github.com/d954mas/2.5d-shooter/tree/new/assets/levels

6 Likes

Here is my take on that. https://github.com/Lerg/defold-tiled-platformer

6 Likes

Thank you, guys! I’m gonna use this weekend to take a good read on those.
I’ll mark as solved but feel free to drop more material.

thank you again!

2 Likes