Page 1 of 2
Love2D and LuaXML
Posted: Wed Nov 23, 2011 5:02 am
by Leon
Hey Guys,
New to Love2d and LUA, but things are going swimingly. Currently I am trying to work how I can use LuaXML with Love2D as attempts to use it are throwing errors up in Love.
Normally you would add the LuaXML.lua file and LuaXML_lib to your project folder and then just load it via require 'luaXML' but everytime I do this it say it is missing LuaXML, LuaXML_lib and then a bunch of other stuff.
Is LuaXML meant to be installed somewhere? Or is something else wrong.
For those who don't know what LuaXML is see
here.
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 3:24 pm
by miko
Leon wrote:Hey Guys,
New to Love2d and LUA, but things are going swimingly. Currently I am trying to work how I can use LuaXML with Love2D as attempts to use it are throwing errors up in Love.
What errors exactly?
Anyways, I would recommend plain lua XML parser, because when you use binary compiled module, your program is no longer multiplatform, and you risk the binary compatibility issue (it depends on which compiler was used to compile love2d and *.dll).
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 3:42 pm
by kikito
Hi Leon,
Why do you need to parse XML in the first place?
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 3:55 pm
by Leon
kikito wrote:Hi Leon,
Why do you need to parse XML in the first place?
Storing data in a easily editable file, for the purpose of future modifications. Thh idea is to make it so I could easily put together new spells through the use of XML files which are then read by the parser and put it in a LUA Table.
Heres a image of the error I get:
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 4:09 pm
by slime
Why not use pure Lua files which just have a table inside them, and then loadstring or love.filesystem.load that?
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 4:09 pm
by nevon
Leon wrote:kikito wrote:Hi Leon,
Why do you need to parse XML in the first place?
Storing data in a easily editable file, for the purpose of future modifications. Thh idea is to make it so I could easily put together new spells through the use of XML files which are then read by the parser and put it in a LUA Table.
Lua is excellent for that. Just store the information as Lua tables.
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 4:20 pm
by Leon
slime wrote:Why not use pure Lua files which just have a table inside them, and then loadstring or love.filesystem.load that?
Because I want end users to be able to stuff just as easy as me. Not everyone knows how to use Lua while a XML table is easy to just look at and edit.
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 5:03 pm
by slime
Personally I find
Code: Select all
{
name = "bolt",
type = "Energy",
damage = 50,
speed = 800,
drain = 8,
timeout = 1,
mass = 0.1,
cooldown = 0.2,
ammo = false,
autoaim = false,
color = {64, 192, 255},
}
much, much easier to read than an XML file.
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 5:21 pm
by Leon
slime wrote:Personally I find
Code: Select all
{
name = "bolt",
type = "Energy",
damage = 50,
speed = 800,
drain = 8,
timeout = 1,
mass = 0.1,
cooldown = 0.2,
ammo = false,
autoaim = false,
color = {64, 192, 255},
}
much, much easier to read than an XML file.
Editing XML files in EXCEL or the open office alternative is easy and nice to do. I know I can do it with LUA, I want to do it with XML. Also I want to do it the other way around as-well, store LUA tables in a XML file.
Re: Love2D and LuaXML
Posted: Wed Nov 23, 2011 5:37 pm
by slime
As others have mentioned, you should probably use a pure Lua solution if you really want XML parsing.
http://lua-users.org/wiki/LuaXml
Also, Lua is not an acronym. It's Lua, not LUA.
I used JAVASCRIPT and PYTHON the other day, but I like the LUA language more.