View Full Version : [WoW] How to get started with add-on development?
brooksd01
06-01-2009, 08:37 AM
The title kind of says it all. For those of you that have spent some time building add-ons, how would you recommend getting started? Are there decent dev tools out there to speed things up, or is it better to just fire up the old text editor and dig in.
I ran across AddOn Studio (http://www.codeplex.com/AddOnStudio) from a quick Google. Any thoughts on it's quality / usefulness?
As for my starting point, I've been developing software for a living for over a decade and have been writing code of one sort of another since my Tandy computer in grade school (something like 1983). In other words I'm looking for more from a "so you want to play with lua" rather than "so you want to start programing" angle.
Stickman12
06-01-2009, 09:14 AM
I'm in exactly the same position (coder by day, 'I'm a raider!' by night), here are a few links I have bookmarked:
http://lua-users.org/wiki/LuaTutorial for a tutorial on basic language features
http://lua-users.org/wiki/LuaLiveDemo for a live demo style thing, similar to online Ruby and Python engines
http://www.wowwiki.com/AddOn#How_do_I_create_an_AddOn.3F a basic overview
The AddOn studio looks very nice, I'm planning on taking a detailed look later. One of best sources I've found is to simply find a very easy addon (with limited functionality preferably) and crack open the lua file to feast on the sticky codey insides :D
Other than that, I think it's probably notepad as an editing tool and going back in time about 15 years ;)
If you find anything awesome, post it here, I'm always keen to find out something new
Eurhetemec
06-01-2009, 11:44 AM
My wife has developed some mods for WoW, and like you two, she's a software developer of long experience. I know she uses some kind of tool for LUA, but I'm not sure what it is (I don't think it's AddonStudio, though), so I'll ask her about that and let you know.
James Ojaste
06-01-2009, 01:09 PM
I've tried a few IDEs and was never really satisfied with any of them. They're generally focussed on building GUIs (which are built with XML for layout and LUA for interaction).
I've not found a lot of really good resources for teaching addon development - luckily for me, I learn well from being pointed at a spec and some examples and being allowed to play. There's a decent tutorial for getting started with Ace3 (http://old.wowace.com/wiki/WelcomeHome_-_Your_first_Ace3_Addon).
What do you need to get started developing addons? Your favourite text editor/IDE (and I highly recommend syntax colouring for learning a new language), two API references (one for LUA (http://www.wowwiki.com/Lua_functions), one for WoW's API (http://www.wowwiki.com/World_of_Warcraft_API); just beware that the WoW API docs on wowwiki are not 100% complete as Blizzard doesn't publish full specs and the API is discovered by people looking for stuff), and a toolkit or two (I've built with Rock and Ace2/3; they're slightly different but pretty equivalent - they save you a lot of work though, so I highly recommend them or something like them).
You'll also want some sort of bug tracking addon that'll let you easily reset your UI - you'll probably be doing that a lot (ideally, with a low-level mule in an unpopulated area with few other addons loaded, so it goes faster). I use BugSack - it's not fancy, but it stays out of my way when I'm not coding and will keep a log if multiple things go wrong.
It's important to know how WoW processes stuff. First off, stuff is only read from/written to the WTF DB on startup and shutdown, so if you're writing to the DB and wondering why you can't see the change in your text editor, that's why. Second, while you can make code changes and reload UI to see the effects, there are some cases where a sufficiently sweeping change will require a client restart. I haven't bothered to nail it down exactly, but I suspect it's caused by WoW reading the .TOC file only on startup. That's point #3 - order of operations: WoW starts off reading the .TOC, which tells it things like the version of the client it was written for, which DB variables should be instantiated within the WTF DB, and which files to load next (along with an implicit ordering). XML files can chain to load other files.
Aside from addons, you can also see how Blizzard put together their stuff by downloading a copy of the official UI's code (http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466). It's a bit more arcane, since they don't have all the nice toolkits to abstract things for you, but if you're looking to just tweak the default UI a bit and can't find a working sample elsewhere, it can be a really useful resource.
brooksd01
06-01-2009, 01:30 PM
So you recommend something like Ace3 right away then? I was wondering if it was worth digging into the libraries right away or if for more simple things they were just an unnecessary abstraction layer.
The initial think I want to work on is customized version of a cool down timer bar if that changes good choices of add on libraries (specific to hunter PvP, and probably already exists, but I need something to actually attempt in a new language to learn it).
James Ojaste
06-01-2009, 06:37 PM
So you recommend something like Ace3 right away then? I was wondering if it was worth digging into the libraries right away or if for more simple things they were just an unnecessary abstraction layer.Yeah, it's really not a thick abstraction layer, but it provides a lot of helpful services. Things like being able to specify that config settings should be managed per-account, per-server, or per-character. An API to setup Timer events so you can trigger things at regular intervals instead of manually watching the system clock.
Stock LUA is pretty barebones, and WoW doesn't offer much but raw functionality. The frameworks really help smooth over some of the rough spots.
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.