Scripting Language

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

Moderators: Forum Moderators, Developers

Post Reply
mrdebose
Posts: 1
Joined: May 13th, 2012, 5:19 am

Scripting Language

Post by mrdebose » May 13th, 2012, 5:31 am

Ok, I am absolutely new at this whole thing. I have been searching for well over an hour now and still have not found what i was looking for. :doh:

My question is what is the scripting language used by Battle for Wesnoth? I have seen both LUA and python tossed around a lot on Google and in the sites create page. If you can, I would thoroughly enjoy having this answered soon and hopefully maybe some one could point me in a direction where their might be some in depth tutorials on how to create new scripts for the game.

My thanks in advanced! ^_^

User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Scripting Language

Post by Crendgrim » May 13th, 2012, 6:58 am

The main scripting language for Wesnoth is WML (Wesnoth Markup Language). With it, most add-ons can be written.
There was some support for a python AI, but IIRC it was removed due to security concerns. Now we have Lua for more advanced tasks than WML can handle (basically Lua is able to create new WML tags, or to manage an AI).
So, I hope this was correct. :P
UMC Story Images — Story images for your campaign!

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1395
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Scripting Language

Post by Elvish_Hunter » May 13th, 2012, 7:59 am

Crendgrim wrote:The main scripting language for Wesnoth is WML (Wesnoth Markup Language). With it, most add-ons can be written.
As the name suggest, WML is a markup language - more like HTML. Its purpose is to describe what happens in a certain scenario. If we want to follow our comparison with a web page, then Lua can be considered our Javascript, as both are scripting languages and both can be used to define functions and other things.
mrdebose wrote:maybe some one could point me in a direction where their might be some in depth tutorials on how to create new scripts for the game.
In that case, you need to learn the Lua language first. This site is a good starting point: http://lua-users.org/wiki/TutorialDirectory
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

User avatar
ancestral
Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Scripting Language

Post by ancestral » May 13th, 2012, 8:36 am

It’s important to know that WML is more than just a markup language. WML contains if statements, conditional tags, variables, and other programming features. WML can do a lot; Lua can do even more. However, WML has much simpler syntax, and for most, is much easier to learn and use.

Resources on the wiki:
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer

Post Reply