Im very very interested in how to make an addon myself as i have some very good ideas but im completely knew to it, im very smart with PC's so once i know how it should be easy. Please if anyones got time, tell me how you make addons or give me some advice and help with what i need to know and what i need to get if annything like downloads and give me step by step instructions would be really great. Thank you :)
Im having a problem, when i make the addon, i make it in a note pad but the tutorial says i need it in the file type "TOC File" "LUA File" and "XML Document" but i cant create those files and document types, only notepad and it wont work for me with note pad. how to i create the right files like i described?
First, you might want to go to windows explorer, go to the Tools menu --> Folder Options --> View tab --> Advanced settings --> turn off the checkbox that says "Hide extensions for known file types".
That way you can see what the file extension for files are. If that checkbox is on, when you save a file called "MyAddon.lua", Notepad actually saves it as "MyAddon.lua.txt" which would be interpreted as a .txt file, not a .lua file. Nevertheless, all TOC, LUA, XML and all other files in the WTF folder are all text files.
Turn off "hide file extensions for known file types". [edit: Xinhuan types faster than I do.]
Rename the files from blah.txt to blah.toc, .xml, .lua, and so forth.
Consider branching out and finding a better text editor than Notepad. Even the Wordpad editor (already installed on your XP/Vista system) does a better job. If you feel like download and installing one of the many free editors out there, you have a choice of about eight billion possibilities at last count. Search these forums for threads arguing over text editor preferences for more opinions. :-)
What this means is that when something interesting happens in WoW, WoW informs the UI that some interesting event has occured. For example, if your mana has changed, WoW will tell us the UNIT_MANA event has occurred, and then you can write code to respond to this event to update your manabar on screen.
Each addon will only listen for events that are related to their addon. A frame is a basic object in WoW that you can use to register your interest in a number of events, when such an event occurs, WoW then runs the code assigned to the OnEvent function of that frame.
A frame can have a width, height, fontstrings, textures, and child frames. These frames are usually created in one of two ways A) Using XML B) Using pure Lua, and sometimes a mixture of both. We recommend you ignore using any XML and just use Lua to create your addon frames because it is easier to debug and easier to read. Almost all addons will need at least one frame in order to respond to an interesting event (unless the addon doesn't need to respond to anything, and just does something all the time).
An addon framework (such as Ace3) is a set of code that provides commonly used functionality (example, localization of addons, function hooking, repeating timers) and provides efficiency by centralizing such tasks into libraries. When learning how to code an addon, you can choose to either
A) Start without using any addon framework (Ace2, Ace3, Rock, Dongle are examples) so you know learn what is happening in WoW. Then when you learn Ace3 or other frameworks, you will appreciate the "shortcuts" and reusable code they provide.
B) Start by using an addon framework, such as Ace3, which hides the wow base API into a higher level. This makes learning easier by hiding the lower level WoW details from you. As you go along, you will then read the source code of the addon framework itself to see how it works and discover the underlying mechanisms that WoW uses.
You can start learning by looking at the code of a small existing addon that you have downloaded and are using.
Rather than trying to start from nothing, I'd suggest finding an addon that's up-to-date and as simple as possible. Read through its code and figure out how it's doing what it does. Then, practice making small changes. For instance, my addon Speedometer just shows a simple frame on the screen with your current ranged attack speed. You could practice modifying the code to add a background to the frame, anchor the frame to your character sheet, or change the stat shown. Granted, without knowing what you're hoping to make, I don't know if any of those things are specifically relevant, but even if they aren't, they'd still help you get comfortable reading Lua code and familiarize yourself a bit with the WoW API.