Thread Tools Display Modes
12-14-10, 06:18 PM   #1
Shialla
A Deviate Faerie Dragon
 
Shialla's Avatar
Join Date: Sep 2007
Posts: 16
Arrow Wanting to Learn How: Addons, LUA, XML

So, lets a say someone who hasn't coded anything in many many years wanted to teach themselves how to make addons for WoW where would they begin? I have no knowledge of XML, just some basic HTML, coding was BASIC back in the 80's.

Any ideas? Help? Suggestions? (Other than don't bother) I'd really like to start trying to learn, as I have a lot of free time.
  Reply With Quote
12-14-10, 06:26 PM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
The best start is to "steal" code

Grab some small addons that only have one function and look at the code.

Some howtos

http://www.wowpedia.org/HOWTO
http://www.wowpedia.org/World_of_Warcraft_API

Next you should get a good editor like notepad++ or sth.

And when you've started come here with your problems to ask
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
12-14-10, 06:29 PM   #3
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
XML is the work of the devil in regards to addon coding, in my opinion (translate: IMO for you 1337 nerds out there).

Just with any language, start with the basics. WoWwiki has a decent startup guide here. Follow that up with the "HOWTO" sections for some more specific examples and tips/tricks.

After that, start downloading some "simpler" addons out there and open them in notepad (or whatever editor of your choosing). Examine the code. Try to follow the function flows and see how they work. This, besides for the core basics in the "Getting started", is perhaps the best option for learning as it can show you a variety of ways to do similar things but in different structures. It's my firm opinion this is actually the best way to learn how to write addons for WoW (though not the best way to learn LUA in general).

There are many others, myself included, that learned from the ground up just as you want to do. It does take some patience and dedication, but once everything "clicks", you'll find it's a lot easier than it looks. As with any coding language, the worst points are where coding can be tedious and repetitive. But in the end, you get a great feeling when it all works the way you wanted to.
  Reply With Quote
12-14-10, 06:30 PM   #4
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Except for some very specific examples you don't have to use XML for anything.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
12-14-10, 06:40 PM   #5
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by nightcracker View Post
Except for some very specific examples you don't have to use XML for anything.
Such as? I have yet to find a single need for it.

I have found one MAJOR downside to XML that caused me to hate it; If you have any errors, your addon simply won't load.

No loading = no error messages for debugging = useless.
  Reply With Quote
12-14-10, 07:07 PM   #6
Coote
A Scalebane Royal Guard
 
Coote's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 440
Originally Posted by Shialla View Post
Any ideas? Help? Suggestions?
Don't bother.

j/k, but somebody had to say it. =P


A good start is reading up on WoWPedia and WoWProgramming. WoWPedia has a fairly decent bit of information for starting out, and the WoWProgramming book is definitely worth it if you don't mind spending $50 or so on a rather large book (it's definitely worth it, though).

http://www.wowpedia.org/Getting_star...writing_addons
http://wowprogramming.com/


Originally Posted by Rilgamon View Post
The best start is to "steal" code

Grab some small addons that only have one function and look at the code.

And when you've started come here with your problems to ask
Pretty much this. I first started out with just modifying addons, and mostly, that's still what I do. I would recommend starting out with changing up oUF layouts. Try taking something nice and simple, such as NC_KillingBlow, and making it print something on levelups, instead of killing blows.


Originally Posted by ChaosInc View Post
XML is the work of the devil in regards to addon coding, in my opinion
FQMFT
__________________

"This is the fifteen-thousandth four hundredth and ninety-eighth occurence".
  Reply With Quote
12-14-10, 10:34 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by ChaosInc View Post
Such as? I have yet to find a single need for it.

I have found one MAJOR downside to XML that caused me to hate it; If you have any errors, your addon simply won't load.

No loading = no error messages for debugging = useless.
Creating templates is one.

You can check your FrameXML.log file in the Logs folder for XML loading errors. Other than that, you can run the XML file through a compiler - the same kind that you would use to check web XML code through - to check for syntax errors.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-14-10, 11:14 PM   #8
Shialla
A Deviate Faerie Dragon
 
Shialla's Avatar
Join Date: Sep 2007
Posts: 16
Thumbs up

I really appreciate all the helpful replies and advice. It's great to see such a helpful and friendly community! I guess I have my work cut out for me starting tomorrow. Woo!
  Reply With Quote
12-15-10, 12:13 AM   #9
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by ChaosInc View Post
Such as? I have yet to find a single need for it.

I have found one MAJOR downside to XML that caused me to hate it; If you have any errors, your addon simply won't load.

No loading = no error messages for debugging = useless.
There is another one, (easily) add keybinding slots to the escape menu bindings screen.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
12-15-10, 07:46 PM   #10
Shialla
A Deviate Faerie Dragon
 
Shialla's Avatar
Join Date: Sep 2007
Posts: 16
So I have hit my first little snag.

IN another thread Phanx, kind soul that he is, gave me some simple instructions on how to fix a particular addon that is broken. He told me to change specific line numbers. So I installed Notepad++ and got to work. The one problem, Notepad++ line numbers and the ones Phanx gave me didn't line up.

I eventually figured out that Notepad++ was adding blank lines between each line of the code. So my questions are:
  • Is Notepad++ the way to go for editing LUA and XML?
  • How do I make it not add those extra lines when I open a file?
  • Is there some plugin or other I should get for working on WoW stuff?
  Reply With Quote
12-14-10, 07:42 PM   #11
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Where to begin?
  1. Grab a Text Editor or IDE: Notepad++ / Notepad2 / IntelliJ IDEA, etc, but NOT AddOn Studio
  2. Modify/copy other (simple) addons
  3. Read the Getting started with writing addons Tutorial
Optionally, get on IRC: irc://chat.freenode.net #wowuidev, #wowace, #wowpedia
Buy the books: Programming in Lua, World of Warcraft Programming
References:
ps: "anything" that can be done with XML, can be done in Lua, so you don't really need to know XML to make an addon
Originally Posted by Rilgamon View Post
The best start is to "steal" code
this, this, and this

Last edited by Ketho : 12-16-10 at 09:19 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Wanting to Learn How: Addons, LUA, XML

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off