WoW:Getting started with writing addons: Difference between revisions

no edit summary
No edit summary
Line 2: Line 2:
The following is a guide for getting started with building WoW AddOns. Creating your own AddOns can be a difficult process at first, but can be very satisfying and is a great way to learn programming in general.
The following is a guide for getting started with building WoW AddOns. Creating your own AddOns can be a difficult process at first, but can be very satisfying and is a great way to learn programming in general.


If you are mostly interested in what files and structure comprise a WoW AddOn, you can skip to [[WoW AddOn]], and come back here or move on from there.
If you are mostly interested in what files and structure comprise a WoW AddOn, you can skip to [[WoW:AddOn|WoW AddOn]], and come back here or move on from there.


== What should I make ==
== What should I make ==
Line 18: Line 18:
Research the programming environment:
Research the programming environment:
* [[Lua]] - This is the programming language used by WoW for UI AddOns.
* [[Lua]] - This is the programming language used by WoW for UI AddOns.
* [[WoW AddOn]] - These pages explain the basic structure of a WoW AddOn.
* [[AddOn|AddOn]] - These pages explain the basic structure of a WoW AddOn.
* [[World of Warcraft API]] - These are the functions and ways to talk to WoW with Lua.
* [[World of Warcraft API]] - These are the functions and ways to talk to WoW with Lua.
* [[Curse Forge]] or [[WoW Interface (site)|WoW Interface]] - Find a real but simple example of an existing AddOn. Most real AddOns, even the simple ones, however can be difficult to read for getting started, with many moving parts.
* [[Curse Forge]] or [[WoW Interface (site)|WoW Interface]] - Find a real but simple example of an existing AddOn. Most real AddOns, even the simple ones, however can be difficult to read for getting started, with many moving parts.
* [[Lua editors]] - A long list of code editors and other tools often used by other AddOn creators.
* [[Lua editors]] - A long list of code editors and other tools often used by other AddOn creators.


Start with making a simple AddOn that has almost no moving parts, where you can see what all of the basic parts are and move forward from there. Use the reference material described above, especially [[WoW AddOn]], as that describes what really makes up an AddOn.
Start with making a simple AddOn that has almost no moving parts, where you can see what all of the basic parts are and move forward from there. Use the reference material described above, especially in [[AddOn|WoW AddOn]], as that describes what really makes up an AddOn.


After completing your first one you will then have enough skill to start to build the real AddOn you wanted to originally make.
After completing your first one you will then have enough skill to start to build the real AddOn you wanted to originally make.
Line 87: Line 87:


== Start Coding ==
== Start Coding ==
Start with the tutorials extracted by the [http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466 Interface AddOn Kit]. The [[WoW HOWTOs]] here has a ton of great examples to help you learn. Don't be shy to dig through someone else's AddOn for help, just be sure to not steal code, and give credit where credit is due.
Start with the tutorials extracted by the [http://us.blizzard.com/support/article.xml?locale=en_US&articleId=21466 Interface AddOn Kit]. The [[HOWTOs]] here has a ton of great examples to help you learn. Don't be shy to dig through someone else's AddOn for help, just be sure to not steal code, and give credit where credit is due.


Beware Lua functions and variables are globals by default and are directly visible to the other addons. If authors blindly use simple and common names, like:
Beware Lua functions and variables are globals by default and are directly visible to the other addons. If authors blindly use simple and common names, like:
Line 135: Line 135:
{{elink|site=FreeKode.org|link=http://freekode.org/wow-first-addon/|desc=World of Warcraft first addon|bydate=May 3, 2015}}
{{elink|site=FreeKode.org|link=http://freekode.org/wow-first-addon/|desc=World of Warcraft first addon|bydate=May 3, 2015}}
{{elink|prefix=     |site=GitHub|link=https://github.com/freekode/TestAddon/|desc=freekode/TestAddon}}
{{elink|prefix=     |site=GitHub|link=https://github.com/freekode/TestAddon/|desc=freekode/TestAddon}}
[[Category:WoW HOWTOs]]
[[Category:WoW HOWTOs]]