Recent comments
| Jahwo's AddOn Writing Guide
5 Average: 5 (7 votes) In this guide I will give you a pretty extensive introduction on how to write your own World of Warcraft AddOns. While following this Guide you will write your first AddOn, called WoW-ProFit which keeps track of your money profits and deficits. You don't need any programming experience if you want to follow this guide, but it would of course be helpful, as I can't possibly explain every nut, bolt and screw. Some talent for independent thinking might be useful, too. If any questions or problems occur, please feel free to ask me via PM or Comment. Table of Contents
Introduction This guide has been written for learning-by-doing, so roll up your sleeves and prepare for hard work! As you will see, the Guide is based on steps. The steps can consist out of three different "segments":
The star
The little AddOn you will write during this guide will show you exactly how much money you have spent or earned in the current playing session. Additionally it keeps track over all the session since it's installation and can display the all-time profit/deficit. This is what it will look like:
WoW-ProFit includes pretty much everything that is needed for this "basic" introduction. Nevertheless you have to note, that this Guide won't give you ALL information you need to write professional AddOns like Cartographer or TourGuide, but it is definitely a step in the right direction So never despair, keep cool and have fun! Tools Everything you need for creating your own AddOns is a simple text editor and, of course World of Warcraft to test you AddOns. ![]() An other quite useful tool, which is completely optional for this guide, is It's an XML-Editor by Microsoft which comes in really handy if you have to struggle with huge xml-files. I won't explain how it works exactly, so if you want to use it you will have to catch on with it yourself. NotePad++ will suffice for this guide as our xml file won't become too big. What is an AddOn As you probably know, an AddOn is a way to customize, modify and extend you User Interface. AddOns are located in a AddOn folder. The path is:
World of Warcraft\Interface\AddOns\
Every AddOn has it's own folder in there and in every addon folder you will most probably find three different types of files:
Setup Before we actually start coding we will prepare the file and order structure. As said above, all our files have to be in their own folder and our .toc file has to have the same name as this folder.
The Frame Now we will create the background and borders for our AddOn. For this we will edit our .xml file and add a Frame. But first of all, a short introduction about XML:
Time for a test-run: Save your files now and start your World of Warcraft client. Log in and check if this entry is ticked in the AddOns list:
Log into your favorite character and you should see a slightly transparent bar in the middle of the screen
If not, don't be upset, just go through the previous steps again. Adversity is the school of wisdom.
Very well, the frame is finished, though we'll have to make some dynamical changes to it later on. Nevertheless, be happy about what you've done so far.
A Button In this chapter we will add the button that will allow us to display the all-time profit/deficit. We can use most of the things we've already learned from the frame on the button as well, because it is derived from the frame element and therefore is a frame too.
Textures and FontStrings Even the
Drag and Drop Now it's time to implement some interactivity with the frame. As a beginning we want the frame to be dragable.
Initialization Some presets and stuff like that we need to sort out while loading the AddOn.
Money Matters Finally it's time to make the AddOn do what it is supposed to do; keeping track of profits.
Money Matters II Only one thing left, we want the AddOn to print the all time profit/deficit of the character in the chat window by clicking on the blue button.
Well done! You've completed the developing of your own WoWProFit AddOn Appendix What Now? Now that you've finished this guide and have written the AddOn you should have learned enough to start programming your own AddOns, so be creative, think about what the WoW-Community could need and go to work. There is only one problem, and that is that you can't possibly know anything you need just by following my guide. For this reason I will give you some links and ressources that helped me a lot when I learned about AddOn writing.
If you have no idea what you could do with your new knowledge you could try to imporve the WoWProFit AddOn, as it has some flaws: I'm really sorry to tell you but there are some pretty elementar things not explained in this guide. For example I did not explain how to implement slash-commands (/whisper stuff) and hotkeys. You will have to work this stuffe up on your own. This should be no problem with sites like wowwiki. Here is a short description on how to get the World of Warcraft internal images and how to get their paths. First of all you need to get Blizzard's World of Warcraft AddOn Kit. You can get it from this page: Blizzard Support Download the file for your system and install graphics package. After the installation is finished you will find a new folder in your World of Warcraft root folder called "Blizzard Interface Art". This folder contains files of the type .blp. You won't be able to open those files with most of your standard image viewers. The program I recommend you to use is XnView. It's a powerful and free image viewer that is able to display .blps in pretty high quality. Now you can look at the images available for your use. The path you have to use in your AddOn is "Interface\" plus the path relative to the "Blizzard Interface Art" folder. The ".blp" ending has to be left away. For example the file "Blizzard Interface Art\BankFrame\UI-BankFrame.blp" would be "Interface\BankFrame\UI-BankFrame" by Jahwo If you want to use this guide or parts of it on WoW-Pro extern websites, please be so kind to ask me first.
| About the author:Location Occupation Main Character Death Knight Level of Addiction User loginNavigationWho's onlineThere are currently 1 user and 494 guests online.
Online users |
Eh?
http://i240.photobucket.com/albums/ff50/Ech0side/WoWScrnShot_062009_143230.jpg
Is it ment to look like that atm? or did i mis-type some coding? i had a few people scan to check it and they all seem to say that its as its ment to be.. Ty for any input
Trusted Member
Mine wont even show as yours
Mine wont even show as yours do :s
There was a few times i went
There was a few times i went ot see the addon ingame and it vanished, I found out i was using engliush spellings, like colour, its Color, and also, Capital letters do seem to make the difference of it working and of it not.
Trusted Member
Going crazy now!
Im starting to go crazy! wont work at all...
Here is my addon (this is where i should check it out at the first step) if anyone can check the code or upload there code i would be a huge help
http://www.drudoo.com/wp-content/WoWProFit.rar
Try a capital N on Name
Try a capital N on Name
Try a small f on file
Caps wise thats all i can see, Try adding the spaces before the /> too maybe?
Trusted Member
Still not working... I have
Still not working...
I have a folder in my wow folder named "Blizzard Interface Art" and the path to that is "/Interface" right?
Really have no idea why it aint working...
Trusted Member
Still doesn't work :s could
Still doesn't work :s could u upload your version so i can see if that is working ? have checked mine twice and cant seem to find any errors...
Trusted Member
Dont work :s
I have made the whole addon, but when i install it, it doesn't show on my screen
Anyone got the same problem?
Moderator
in your WoWProFit.toc file
in your WoWProFit.toc file try changing
to
According to WoWWiki,
According to WoWWiki, wouldn't it be 30100, not 31000?
Trusted Member
yeah, according to wowwiki
yeah, according to wowwiki it is but since it is constantly changing i don't think it is up to date at all times as of now try with ## Interface: 30103
It would not really matter though you can enable it even if it is wrong interface code, in the addon button on the wow character selection screen
Honored Member
Question
i'm at the first test ...when i make sure the addon is checked off in the addon screen it says incompatible is that supposed to happen?
Honored Member
Confused
I am confused about how to create a luafile or a TOC file. How do i make a file lua or TOC
Moderator
Create a new file with your
Create a new file with your texteditor and use the "save as" function. Now enter "xxxx.lua" or "xxxx.toc" as filename (where xxxx is the name you want to give the file) and save it.
Honored Member
Ok
Ok thanks for clarifying
Moderator
The whole AddOn developing
The whole AddOn developing part is finished now. Only some things for the appendix ar left
By the way, will you have
By the way, will you have some section about the actual code and functionality?
I'm really looking forward to see this part
Moderator
Sure that's what's coming
Sure
that's what's coming up next
Moderator
New chapter Textures and
New chapter Textures and Fontstrings completed.
Moderator
Jahwo, this is just looking
Jahwo, this is just looking really nice. Very professional, top notch quality. If I ever have free time again, I am going to dive into this and play with addons! Too bad right now I just don't have the time
Amazing!
I didn't read the whole guild yet, but after reading a bit I can say it's AMAZING!!!
I did write an addon for the Titan panel, a button that will hide the recount window (much like a similar built-in button for omen
) but while doing this there wasn't any introductory simple guild on how to start making one.. So it took a lot of reloads until I got all the errors out 
I'd like to point out, that your guide is well structured, and for a beginner in coding and addon writing it is really easy to use. For an actual developer (I mean non WoW developer) it's also very informative and not boring(!)
Great job on both the actual contents, and the presentation
10/10
Moderator
This is a completely new
This is a completely new version of the guide I started before. I changed the concept a bit as well as the formatting.
Also the "example" addon is completely different because the old one was not suitable enough. This one gives me the possibility to explain every basic thing about addon writing.
Still this is only work in progress but again I decided to prerelease it to get feedback, as it is usable until the current end.
I hope you like it
Jahwo