Skip to main content
gamedev.net
🔒 Locked

XML + Lua

Started by Omega55 1 reply 850+ views
Original Post
Omega55
Omega55
I was thinking, you can use XML for your objects since its hierarchial, and Lua is a script. So how about mash them together for a scriptable XML sort of thing? Like for example, you would load a "template" for an object in your game: <xml> <object name="Bob" status="Alive"> <stats/> <state id="idle" status="on"> PutText("Hello",10,10) </state> </object> </xml> Then you just use an XML parser to get the text in the idle state.
This is supposed to be handwritten...
JWalsh
JWalsh
The combinations of XML and Lua is what Blizzard does for their WoW Interface. The interface elements are created in XML, and the event handlers are provided with Lua functions referenced from within the XML.

Additionally, .NET 3.0 uses C#, etc... and XAML (eXtensible Application Markup Language ie. XML) to code the entire interface, both the graphics, event handlers, data binding, etc...

The combination of XML or XAML to specify object properties, combined with a powerful programming language is the future of interface development at the very least.

But the technology can be used for much more. Intelligent Agents, Physical Objects within an MMO, etc...

Cheers!
jeroenb
jeroenb
I also use the combo of XML and Lua in my engine for the user interface. The interface is described in XML and also contains the implemented event handlers for each control. This combo works very well.
Crafter 2D: the open source 2D game framework ?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.