Hey guys, I'm back.
Anyway, I want to use Tiled to make the maps for my new project. I'm wondering if there's a Lua-based XML parser anyone would recommend.
The Lua Users wiki has a page on Lua XML parsers. Have any of you tried them with the map files created by Tiled?
XML Parser (for Tiled map files)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: XML Parser (for Tiled map files)
If I remember correctly, Tiled exports directly to Lua (at least the Java version does)
When I write def I mean function.
Re: XML Parser (for Tiled map files)
Aww. I want to use the nice shiny QT version.
Though, I suppose the Java version will do since Lua files would be easier to work with.
As an aside, Lua files are loaded by require-ing them. Is it possible to "unrequire" a file?
Though, I suppose the Java version will do since Lua files would be easier to work with.
As an aside, Lua files are loaded by require-ing them. Is it possible to "unrequire" a file?
Re: XML Parser (for Tiled map files)
Use dofile() so that you can do it multiple times in the case that you want to load the same level again later on.
You can't unrequire(), so you should structure it so that the level file edits global variables that you can set to nil when you unload the level.
You can't unrequire(), so you should structure it so that the level file edits global variables that you can set to nil when you unload the level.
Good bye.
Re: XML Parser (for Tiled map files)
I've used LuaXML for saving map data. It works great and is really simple, but the more I look at what the map files look like in Lua vs XML the more I tend to think that there's no reason for not just having everything saved entirely in Lua.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 52 guests