In the search for relevant and authentic tasks for young programmers, I have been looking at programming addons for World of Warcraft. Addons are used to customise the game's user interface. There are a number of popular
addons including
CT Raid Assist.
Blizzard warn that creating addons is not easy: "The creation of AddOns is a very technical endeavor, and you should not attempt it unless you have a good working knowledge of
XML and
Lua " Nevertheless, I was able to easily follow the Hello World tutorial. All I needed was Notepad and of course WoW to test the addon.
Getting StartedGo to
http://www.blizzard.com/support/wow/?id=aww01671p and download the World of Warcraft Interface AddOn Kit.
WoW addons are written in
Lua and
XML. The kit extracts the XML files and Lua files for the addons and the user interface into directories. To see how the WoW interface is programmed, see the user interface directory "FrameXML".
The kit also installs the tutorial files.
Do the Hello World tutorial
Read about WoW Interface Customisation at
WoWWiki in particular the
APIAddons all have an XML file which describes the visual features of the addon, where more detailed programming is required, functions are called from a Lua file.
LuaLua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight scripting language for any program that needs one. Lua is implemented as a library, written in
clean C (that is, in the common subset of ANSI C and C++)
Lua is
freely available and can be used for both academic and commercial purposes at absolutely no cost. You can experiment with the
stand alone version of Lua.
XMLXML stands for EXtensible Markup Language
XML is a markup language much like HTML.
XML was designed to describe data
.XML tags are not predefined in XML.
You must define your own tags.
XML is self describing.
XML uses a DTD (Document Type Definition) to formally describe the data.
Slash CommandsSlash commands such as /sit and /dance can be entered in game in the chat window, two notable ones are /macro and /script
MacrosSlash commands can be put into
macrosScriptsUsing the /script command,
Lua scripts of
API calls can be executed from the game chat window. This can be used to test code fragments immediately, prior to using them in addons.
For example,
/script message("Hello World") will bring up a message box
/script SendWho("gold") will list all players with gold in their name
/script message(GetMoney() ) your held money in copper in a message box
/script message(GetMapInfo()) will display your current location in a message box
/script RandomRoll(10,20) rolls a random number 10
<20>
/script OpenAllBags() Open/Close all bags
/script x,y=GetCursorPosition() ; message(string.format("x%d y%d",x,y)) gives cursor position
In Summary
Lua is a powerful open source programming language which can be used to write addons for the World of Warcraft user interface. WoW is a popular MMORPG game with subscription costs of $A20 (US$15) per month. There are currently 7 million subscribers.
For one purchased game, the installation disks can be used to install WoW onto a number of computers though one account would only allow one computer to be online at a time for testing of code. Typically 10% to 50% of an Australian school will be existing WoW account holders. The challenge should be achievable for years 11 and 12.
Labels: WoW