Thread Tools Display Modes
12-12-06, 12:43 PM   #1
Bouvi
A Chromatic Dragonspawn
 
Bouvi's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 195
How do I get started in Addon programming?

Hmmmmm nevermind either I am a dunderhead which is possible and did not scroll down far enough or this message magically opened a new door....

I am fading awa....
__________________
Bouvi
WoWi Member since June 2005 and darn proud of it!

Last edited by Bouvi : 12-12-06 at 09:27 PM.
  Reply With Quote
07-13-10, 03:23 PM   #2
Infamouss1985
A Kobold Labourer
 
Infamouss1985's Avatar
Join Date: Jul 2010
Posts: 1
OK i need help please

Hey im new in this can you guys please help me were can i find the program to create my own addons please help me
  Reply With Quote
07-13-10, 03:55 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
You can start creating your addon with notepad. There are enhanced versions out there like Programmer's Notepad and Notepad++ but for small addons notepad is enough for the budding author.

Next step is to bookmark the following pages at the least:
www.wowwiki.com
wowprogramming.com

Both those sites will give you access to functions/forums/objects etc available for the addon author.

After that, find a small addon that does something simple and see if you can see how it does what it does. Then see what you can do to make it look or do something different. Or, you may already have an addon that has stopped working, that you can now see if you can fix for the other users out there. Especially if the author is unable to at the present time.

If you get stuck, you can also post on the forums and we can help you on your way.

There are 2 ways to creating an addon ( addon.toc, addon.lua ) or ( addon.toc, addon.xml, addon.lua ). In other words. You can either write a pure lua addon or utilise the xml system to design your addon and use the lua to do the other side of things.

Now that that has been said. This link will help you write your very first simple addon.

http://www.wowwiki.com/Getting_start...writing_addons

You can then use that as a template for your others by building on the code/changing the code etc as you need.
__________________

Last edited by Cladhaire : 07-20-10 at 09:14 AM.
  Reply With Quote
07-13-10, 03:57 PM   #4
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Infamouss1985 View Post
Hey im new in this can you guys please help me were can i find the program to create my own addons please help me
It's not a program, it's a language. But I have a feeling about this...

Sidenote/Warning
If you're looking to create an addon for the explicit purpose of getting a beta key, save yourself the trouble. They'll screening for these types of scams so that legit authors don't get screwed.
  Reply With Quote
07-20-10, 05:08 AM   #5
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
I recommend getting the World of Warcraft Programming Guide. Very cheap too! used! On Amazon, I got mine for 60 cents! Perfect new condition too! Though, its burning crusade, it's still a great reference.

edit - meh nvm, but yeah check out cheap used books on amazon

Last edited by Ferous : 07-20-10 at 05:13 AM. Reason: Punctuation
  Reply With Quote
07-20-10, 09:15 AM   #6
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
The new version of the book was released this past year, perfectly for Lich King and Cataclysm!
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
07-20-10, 10:09 AM   #7
infamy
A Murloc Raider
 
infamy's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 9
The James Whitehead/Rick Roe one? I'm actually interested in learning a bit more, I just want to make sure I'm grabbing the correct book:


http://www.amazon.ca/World-Warcraft-...9641855&sr=1-1

I really would benefit from a square one reference guide.
  Reply With Quote
07-20-10, 10:32 AM   #8
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
That is indeed the book we wrote =)
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
07-20-10, 10:41 AM   #9
infamy
A Murloc Raider
 
infamy's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 9
Awesome possum, that's one more copy sold, then.
  Reply With Quote
07-20-10, 11:23 AM   #10
Thomdril
A Murloc Raider
Join Date: Jul 2009
Posts: 9
Ditto, I was telling my wife just yesterday that I wanted to try my hand at programming/scripting and figured what better way then with LUA The last language I played around with was FORTRAN to give you an idea of how old my skills are in that area.

Thanks for all the references!
__________________
  Reply With Quote
07-20-10, 01:05 PM   #11
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
Originally Posted by Thomdril View Post
Ditto, I was telling my wife just yesterday that I wanted to try my hand at programming/scripting and figured what better way then with LUA The last language I played around with was FORTRAN to give you an idea of how old my skills are in that area.

Thanks for all the references!
Also, Programming in Lua is a cool introduction to Lua itself

Last edited by d87 : 07-20-10 at 03:34 PM.
  Reply With Quote
07-20-10, 03:08 PM   #12
Ferous
Sheer Sense of Doom
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 863
Originally Posted by Cladhaire View Post
The new version of the book was released this past year, perfectly for Lich King and Cataclysm!
I know, but getting the burning crusade one for 60 cents... You can't beat that! But, some used WOTLK ones go for 22 dollars, I must wait to get that But, I will, as it seems to have more in it than the BC one (BC one seems to be more about xml than lua)
  Reply With Quote
10-14-10, 12:19 PM   #13
Drethic
A Defias Bandit
Join Date: Nov 2007
Posts: 2
What's the chances we could get the WoW Programming Guide (Amazon Link) pushed to the Kindle? Some programmers have to work other places and it's easier to hide my kindle then a bright blue book
  Reply With Quote
10-14-10, 12:21 PM   #14
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
That depends entirely on my publisher, I suggest you note your interest on Amazon =)
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
01-14-11, 08:54 PM   #15
mroz123
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 1
Try to get used to program everything in lua from the start. I think it's much better then using XML in the long run.
Also do not start with libraries. I almost want to pull my hair out when I see totally trivial addon using ton of libraries.
  Reply With Quote
01-15-11, 04:04 AM   #16
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Your lack of using XML is personal preference and I happen to disagree with it.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
01-15-11, 07:42 PM   #17
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
There are reasons why making frames in Lua is preferred over doing it in XML.

1. Error checking is easier. If the XML file contains a syntax error, WoW doesn't tell you which line it is on. You have to use an XML parser (such as opening the XML file in Internet Explorer) which will then tell you what line gave an error. The Lua interpreter doesn't give an error unless there is code that expects a frame to be present.

2. Creating frames in Lua is far less verbose. It is less lines of text and fits on a page of text easily rather than 3 times the amount of lines. Less chances of mistakes is good.

3. Frames in XML are always created (excluding templates). Frames in Lua have the opportunity to be created only when needed on demand.

4. For code in Lua to access a frame or texture created in XML easily, you need to name the frame/texture (which adds it to _G). Although this is circumventable with a bit of tricks, if the frame/texture is simply created in Lua and assigned to local variables or table subentries, we wouldn't have this problem.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
01-16-11, 04:18 AM   #18
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Originally Posted by Xinhuan View Post
There are reasons why making frames in Lua is preferred over doing it in XML.
For some people, yes. People make it sound like a universal and that is just not the case. A mixture of XML and Lua should almost always be used in order to make the best use of the UI subsystem.

1. Error checking is easier. If the XML file contains a syntax error, WoW doesn't tell you which line it is on. You have to use an XML parser (such as opening the XML file in Internet Explorer) which will then tell you what line gave an error. The Lua interpreter doesn't give an error unless there is code that expects a frame to be present.
Except XML files can be validated, which is even more than checking syntax. It can tell you if you don't have things structured properly, if you're supplied attributes that don't apply to a frame. That's no different than having to 'run' the addon to see if your Lua code works, and gives you much more feedback.

2. Creating frames in Lua is far less verbose. It is less lines of text and fits on a page of text easily rather than 3 times the amount of lines. Less chances of mistakes is good.
Until you have to make templates, in which case Lua gets more verbose than XML, or you have to wrap things in factory functions which may or may not work.

3. Frames in XML are always created (excluding templates). Frames in Lua have the opportunity to be created only when needed on demand.
This is also a good thing, because the definition of the frame and its sub-components are atomic and are always created correctly. I would wager that a large percentage of frame-level problems that exist are because frames are created (improperly) in Lua.

4. For code in Lua to access a frame or texture created in XML easily, you need to name the frame/texture (which adds it to _G). Although this is circumventable with a bit of tricks, if the frame/texture is simply created in Lua and assigned to local variables or table subentries, we wouldn't have this problem.
There are no tricks. There has been an attribute for this since late 3.x. You can assign a sub-frame to have a key set in the parent table. Certainly you'll have to look up the first frame, but why is that a problem?

I'm not saying XML is always the answer.. but people avoiding it completely are doing themselves a disservice.

1. If your frame needs to have a name (or should have a name), which is most, then it should have a name. If you're doing this in Lua or XML it doesn't matter and the 'lookup' argument fails.

2. If your frame needs to be created when the addon is loaded, why does it matter that you can create them dynamically using Lua? Why NOT create your main frame in XML if you so desire?

People who sit here and evangelize their hate of XML without espousing any of its benefits to newer members of the addon community do absolutely everyone a disservice.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."
  Reply With Quote
01-16-11, 04:35 AM   #19
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
Originally Posted by mroz123 View Post
Try to get used to program everything in lua from the start. I think it's much better then using XML in the long run.
Also do not start with libraries. I almost want to pull my hair out when I see totally trivial addon using ton of libraries.
another reason to avoid libraries when just learning how things are working is that libraries often obfuscate how things are working by hooking base functions or mimicking widget classes. since lua is effectively typeless, there aren't any declarations to let you know that "myGUIFrame" is a wow api frame vs an ace widget or some other possible entity.
  Reply With Quote
01-16-11, 08:17 AM   #20
desfido
A Defias Bandit
Join Date: Mar 2005
Posts: 2
Originally Posted by lilsparky View Post
since lua is effectively typeless
It's not. It's a strongly typed language with dynamic typing. Saying it's effectively typeless is no more useful, nor accurate, than saying C is effectively typeless (since it's weakly typed).

The important piece of information you are trying to convey is that in lua, the type of variables isn't explicitly declared, which is something entirely separate and distinct from whether there is an effective lack of types.

I understand why this issue comes up with folks -- Lua is more generous with allowing arithmetic values to be used in string contexts than someone might otherwise expect, and many people have the misfortune to have mostly programmed only with some combination of Java, C, and C++ and therefore don't always think clearly about the ideas of implicit type declarations and dynamic typing. But I think calling Lua "effectively typeless" conveys misinformation about a very practical aspect of CS theory and the Lua language.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » How do I get started in Addon programming?

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