WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Dev Tools (http://www.wowinterface.com/forums/forumdisplay.php?f=41)
-   -   How do I get started in Addon programming? (http://www.wowinterface.com/forums/showthread.php?t=7354)

Bouvi 12-12-06 11:43 AM

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....

Infamouss1985 07-13-10 03:23 PM

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:banana:

Xrystal 07-13-10 03:55 PM

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.

ChaosInc 07-13-10 03:57 PM

Quote:

Originally Posted by Infamouss1985 (Post 197475)
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:banana:

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.

Ferous 07-20-10 05:08 AM

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 :)

Cladhaire 07-20-10 09:15 AM

The new version of the book was released this past year, perfectly for Lich King and Cataclysm!

infamy 07-20-10 10:09 AM

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.

Cladhaire 07-20-10 10:32 AM

That is indeed the book we wrote =)

infamy 07-20-10 10:41 AM

Awesome possum, that's one more copy sold, then.

Thomdril 07-20-10 11:23 AM

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!

d87 07-20-10 01:05 PM

Quote:

Originally Posted by Thomdril (Post 198981)
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

Ferous 07-20-10 03:08 PM

Quote:

Originally Posted by Cladhaire (Post 198953)
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)

Drethic 10-14-10 12:19 PM

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 ;)

Cladhaire 10-14-10 12:21 PM

That depends entirely on my publisher, I suggest you note your interest on Amazon =)

mroz123 01-14-11 07:54 PM

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.

Cladhaire 01-15-11 03:04 AM

Your lack of using XML is personal preference and I happen to disagree with it.

Xinhuan 01-15-11 06:42 PM

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.

Cladhaire 01-16-11 03:18 AM

Quote:

Originally Posted by Xinhuan (Post 226821)
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.

Quote:

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.

Quote:

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.

Quote:

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.

Quote:

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.

lilsparky 01-16-11 03:35 AM

Quote:

Originally Posted by mroz123 (Post 226748)
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.

desfido 01-16-11 07:17 AM

Quote:

Originally Posted by lilsparky (Post 226842)
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.


All times are GMT -6. The time now is 05:55 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC