Hoping to learn Addon creation

Hello. I was wondering if anyone could help me with starting to learn addon creation. I have the wowprogramming book and I’m up to the part where it starts to discuss the XSD for WoW. It links to a page and resource that doesn’t exist as far as I can tell. They call it the XML User Interface Creation Tool.

Also, they reference the XSD for WoW’s UI and I can’t find that anywhere either. It’s linked to http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd but I can’t find that resource either.

Is there somewhere I can find these things? Also, is there a reference somewhere of the current addon library and the functions it contains?

Thank you!

You don’t really need to know about the schema other than it’s part of the header tag for defining WoW UI elements in XML (they can also be defined/created directly in lua depending on your preference and the what you are wanting to do).

If you open an addon file that uses XML to create frames you will see the schema in the Ui tag at the beginning of the file and tha’t about the extent of the XSD knowledge required.

There was a UI creation tool a long time ago but it doesn’t work now. It didn’t really do a great job.

1 Like

Yeah I still don’t understand what the use of that information is if it can’t be directly linked
https://www.townlong-yak.com/framexml/live/UI.xsd

But you don’t necessarily have to use XML for an addon. I would suggest these tutorials for getting started with writing addons
https://old.reddit.com/r/classicwow/comments/bvbqo1//epokyf1/

1 Like

Thank you both for the replies.

That townlong site is crazy. How did he get all that information? I guess he knows how to scrape Lua in WoW?

Pretty neat :slight_smile:

You can extract the Blizzard UI from the game yourself:
https://wow.gamepedia.com/Viewing_Blizzard%27s_interface_code

It’s a handy reference :slight_smile:

1 Like

Thanks!

Eh

Hey. Thanks for your help before. I have a question while reading the APIDocumentation. As an example:

ItemLocation = {};
ItemLocationMixin = {};

--[[static]] function ItemLocation:CreateEmpty()
local itemLocation =CreateFromMixins(ItemLocationMixin);
return itemLocation;
end

--[[static]] function ItemLocation:CreateFromBagAndSlot(bagID, slotIndex)
local itemLocation = ItemLocation:CreateEmpty();
itemLocation:SetBagAndSlot(bagID, slotIndex);
return itemLocation;
end

So these are the first two functions declared in the ItemLocation namespace (table). They are CreateEmpty and CreateFromBagAndSlot. I’m curious about why they’re written the way they are. In Lua, the : colon operator denotes that the first argument passed to the function called after the colon will be the table that the function is listed in. Then you use the self keyword to access it.

However, the two functions shown are created using the colon operator but don’t use the self argument anywhere in them. Why did they do this? Why didn’t they just write:

ItemLocation.CreateEmpty()

Since ItemLocation:CreateEmpty() is the same as ItemLocation.CreateEmpty(self) with self being a reference to ItemLocation?

This seems odd to me. Do they do this just to keep convention for function declarations?

Thanks for any help you can give.

Most likely just convention. Also, the UI/API has had more than one person working on it over the years and while most things tend to follow what may or may not be an internal convention, you will occaisionaly come across what appear to be inconsistencies.

I don’t know of any published standards guide.

For most, the term “NameSpace” is usually in reference to the table passed to each .lua file along with a string with the name of the addon.

lua file1.

local addonName, addonTable = ...
addonTable.SomeVar = "Hello from file 1"

lua file2

    local addonName, NS = ...
    print(NS.SomeVar) -- prints 'Hello from file 1"

The “NameSpace” (addonTable) is unique to the addon.

1 Like

OK. Seems to be convention to me too.

Thanks!