Lua & WML, when to use what?

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Post Reply
dracut
Posts: 7
Joined: September 29th, 2018, 4:06 pm

Lua & WML, when to use what?

Post by dracut » September 29th, 2018, 8:33 pm

What is Lua used for exactly? I was under the impression that WML was the sole scripting language of wesnoth. Is the language an alternative to WML? How do the two relate exactly?

User avatar
Pentarctagon
Forum Administrator
Posts: 3543
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Lua & WML, when to use what?

Post by Pentarctagon » September 29th, 2018, 8:55 pm

WML is the original, homegrown markup-language-turned-scripting-language that Wesnoth uses. Lua support was added later in (IIRC) 1.7, and in many ways they are interchangeable - in fact, many WML tags are now implemented in lua themselves(see here), and you can define your own action and conditional WML tags via lua if you want.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

dracut
Posts: 7
Joined: September 29th, 2018, 4:06 pm

Re: Lua & WML, when to use what?

Post by dracut » September 29th, 2018, 9:06 pm

Awesome! So will WML become deprecated eventually in favor of lua in future releases?

User avatar
Pentarctagon
Forum Administrator
Posts: 3543
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Lua & WML, when to use what?

Post by Pentarctagon » September 29th, 2018, 9:10 pm

I won't say that's impossible, but I also wouldn't make any choices on which to use in a particular situation right now based on the assumption that WML might go away eventually either.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Celtic_Minstrel
Developer
Posts: 1225
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Lua & WML, when to use what?

Post by Celtic_Minstrel » September 29th, 2018, 10:56 pm

It's possible that ActionWML (the scripting portion of WML) will become deprecated in favour of Lua in a future release. It's far less likely that other uses of WML will be deprecated though.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply