Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:AddOn programming tutorial/Introduction
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Review == You have created your first AddOn and have successfully run it. Now let's review a bit about what was accomplished. The 'Hello, World!' text is taken from the line in the HelloWorld.lua file that reads 'print("Hello, World!");'. Wrapped around that is a function named "print" which is responsible for displaying the text in the default chat window. The print function is inside a function we created called "HelloWorld" that had no parameters. Our function will do the same thing every time it is called. The name of our function was then placed in the HelloWorld.xml file as the action to be taken when the ''Onload'' event of the ''Scripts'' tag of the Frame we created. We placed the name of our function in this specific place because we wanted our function to be executed (run, called, processed) when our Frame was fully loaded. WoW knew that it should create our Frame because we placed the name of the .xml file into the .toc file. The .toc file must have the same name as the AddOn's directory and is the first of the files in our AddOn that Blizzard processes. Inside the .toc file is where we tell WoW about our AddOn (the ## statements) and what files that need to be loaded. Every line that does not start with a ## is a file to be processed by WoW. The order in which the file names appear is important because WoW processes the files in the order listed. Knowing this, we place the .lua file before the .xml file because we want the function HelloWorld declared (or defined) before we try to call it in the .xml file. Even though this is a trivial example of an AddOn, important concepts and information have been covered. Further pages in this tutorial will cover other areas and expand upon topics initially presented here.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)