Scripting Language

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

Moderator: Forum Moderators

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

Scripting Language

Post by mrdebose »

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 »

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
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Scripting Language

Post by Elvish_Hunter »

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, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Scripting Language

Post by ancestral »

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