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.
Love2D and LuaXML
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Love2D and LuaXML
What errors exactly?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.
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).
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Love2D and LuaXML
Hi Leon,
Why do you need to parse XML in the first place?
Why do you need to parse XML in the first place?
When I write def I mean function.
Re: Love2D and LuaXML
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.kikito wrote:Hi Leon,
Why do you need to parse XML in the first place?
Heres a image of the error I get:
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Love2D and LuaXML
Why not use pure Lua files which just have a table inside them, and then loadstring or love.filesystem.load that?
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Love2D and LuaXML
Lua is excellent for that. Just store the information as Lua tables.Leon wrote: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.kikito wrote:Hi Leon,
Why do you need to parse XML in the first place?
Re: Love2D and LuaXML
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.slime wrote:Why not use pure Lua files which just have a table inside them, and then loadstring or love.filesystem.load that?
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Love2D and LuaXML
Personally I find
much, much easier to read than an XML file.
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},
}
Re: Love2D and LuaXML
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.slime wrote:Personally I findmuch, much easier to read than an XML file.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}, }
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Love2D and LuaXML
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.
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.
Last edited by slime on Wed Nov 23, 2011 5:38 pm, edited 1 time in total.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests