Lua versus WML?
Moderator: Forum Moderators
Lua versus WML?
Does anyone have any experience in "Lua versus WML"? I assume that WML has more generic
and far reaching support than Lua but I would be interested how far one can go via lua. For me it
may be easier to go via lua for my campaign, but my impression is that WML is more widely in
use - but I may be wrong. I really don't know right now, hence why I wanted to ask this question
specifically, e. g. advantages/disadvantages of lua versus WML centric approaches.
and far reaching support than Lua but I would be interested how far one can go via lua. For me it
may be easier to go via lua for my campaign, but my impression is that WML is more widely in
use - but I may be wrong. I really don't know right now, hence why I wanted to ask this question
specifically, e. g. advantages/disadvantages of lua versus WML centric approaches.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Lua versus WML?
WML is more widely used since it's (usually) simpler to use and easier to start off with. Lua is not as easy to use compared to WML, but it is more concise and allows you to do many more things than WML would.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Lua versus WML?
My first impression is that Lua has lots of functions that require you to know WML anyways, like this:
https://wiki.wesnoth.org/LuaAPI/wesnoth ... ts.matches
But of course it's a full-featured programming language, if you've used one like C# or Java then you know what to expect, while WML you're not sure what it can do easily.
https://wiki.wesnoth.org/LuaAPI/wesnoth ... ts.matches
But of course it's a full-featured programming language, if you've used one like C# or Java then you know what to expect, while WML you're not sure what it can do easily.
- Celtic_Minstrel
- Developer
- Posts: 2216
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Lua versus WML?
Lua is not a substitute for WML. It's only a substitute for ActionWML, which is a subset of WML.
You can pretty much write an entire campaign in Lua apart from the unit type definitions and the campaign and scenario definitions, if you want. World Conquest gives some idea of how to go about that. There are a few places where Lua is still inferior though – for example, you can't register a serializable, one-off event using pure Lua. (That's the equivalent of nesting
[event]
tags.) You can easily register recurring events, though; and you can create a one-off event if you really want. It'll just break when you reload the game from that point… or you can write the event in ActionWML even if it's registered from Lua.