Thread Tools Display Modes
06-29-09, 10:08 AM   #1
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Updating addons to current patch..

Hi guys,

First let me start off by saying, the information I'm gathering is not to attempt to rip off other addon authors/dev's. (As someone so politely asked me in another forum)

What I'm trying to find out is: How do you update an addon to be compatible with the current WoW release?

I've searched google and forums, but usually what I find is "just change xxxxx in the .toc file" and I know this to not be what I am looking for. Currently, I own "World of Warcraft Programming" and am trying to learn XML/LUA so that eventually I may create my own addons, and while the book is great, as are websites, I find I learn better by looking at other works already working. I'm on the PTR and right now all of my addons I have work, with the exception of FuBar. I have all of the little plugins for FuBar, but the bars themselves do not show up. It is quite possible that the author of FuBar will update for patch 3.2, but I've chosen that as my "Lets look at this and try to figure out how to make it work" piece.

The only programming I'm familiar with is HTML and a little CSS from designing websites. I learned HTML by looking at others' codes and 'tweaking' it to make it do what I want, if that makes any sense? Now I can write a full website without having to cross-reference any other sites. That's how I learn.

Apologies for being so verbose! If anyone is able to help me, I would greatly appreciate it. I know from the book and other sites that Blizzard changes/updates the API (which I have yet to figure out completely) and that is what usually needs to be updated to make an addon compatible with the latest WoW version, but I have no clue how to go about doing that. Until I can figure it out, I'm not comfortable creating my own addons, as I know firsthand how fustrating it is to find a great addon only for the author to let it go..

Many thanks,

Chance
__________________
  Reply With Quote
06-29-09, 10:26 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
They are right in suggesting a change to the ToC in some cases.

For example, as you have said most of your addons work fine on the PTR. These it seems would only need the ToC version changed so that you do not need to tick the Load Outdated Addons box.

For those that do not work however, as such with fubar, you would first have to locate the cause of the problem. Having an addon such as Bugsack will help you identify the cause of the problem down to each line of the lua/xml file causing the problem.

The main reason addons break with a big patch like this is due to changes that Blizzard has made to an element of the game that the addon in question is trying to access.

For example:

If fubar say had a line as follows (imaginary code follows):

FubarFrame:SetTop(UIParent:GetTop())

to align its bars to the top of the game window and Blizzard changed UIParent to say UIFrame then it would simply be the case of making that change. But first you would have to locate why UIParent doesn't exist anymore and what its new replacement is.

This is where the PTR Diff files that are floating around comes into play. They will highlight any changes made and what they are. In most cases you will recognise the new name easily by its usage in the different coding shown.

This is how I handle my addons and may not be the ideal way of handling such scenarios but I am sure others will have any other suggestions.

Also if you haven't played with lua or xml before then you might want to look at wowwiki's page on User Interface changes to help you take those first steps.
__________________
  Reply With Quote
06-29-09, 02:09 PM   #3
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
ok, that makes sense. Thanks for explaining in "peanut butter & jelly terms" for me lol. I do have bugsack, and have always used it when posting any errors I get on WoWUI or Curse to help the authors figure out what my problem was. I tried checking bugsack for any FuBar errors but I was unable to find any. I saw plenty for some addons I do not use anymore (ie. Cartographer_Herbalism for example) but nothing for FuBar.

This definately helps me for future updates, knowing what to look for and where to go. So am I correct in understanding that the API changes (what 'breaks' the addons) are all located in the .toc file? And if I go to the PTR and an addon is working, then I just need to change the Version Number line in the .toc file at the top and that should be it, correct? (that'll make it so I dont have to check "load out of date addons").

Please advise if I misunderstand any of that ^.^
__________________
  Reply With Quote
06-29-09, 03:45 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
You've almost got it.

The ToC file holds a list of which files are used for each addon. Here's an example from one of mine:

Code:
## Interface: 30100
## Title: nUI: InfoPanel [|cffeda55fMage Ports|r]
## Author: Xrystal
## Version: 1.02.01
## Notes: This mod adds a Portal/Teleport Box into the nUI information panel
## RequiredDeps: nUI
## DefaultState: Enabled
## LoadOnDemand: 0
## SavedVariables: MagePorts_Defaults

localization.enUS.lua
localization.enGB.lua

MagePorts.lua
nUI_InfoPanel_MagePorts.lua
The interface line is the number that needs to change for each major game change if you do not want to tick the Load Out of Date Addons from the Addon Screen on your character selection screen. This is what you understood correctly. However, the ToC file itself cannot break the addon but the functionality the addon does can. At the bottom of the file will be a list of files and it is most likely one of these that will cause the problem and usually a lua or xml extension file.

An example from one of my smaller addons is this function here :

Code:
        if ( IsRaidLeader() or IsRaidOfficer() ) then
                SendChatMessage( sText, "RAID_WARNING");
        elseif ( GetNumPartyMembers() > 0 ) then
                CatchAndThrow_AddWarning(sText);
        else
                CatchAndThrow_AddWarning(sText);
        end
In this example IsRaidLeader, IsRaidOfficer and GetNumPartyMembers are all Blizzard commands. If Blizzard changed the name or return values of any of these then this addon would break. Something like bugsack should highlight this by listing which file and line was being executed when the error occurred. You can then track back as required to find which Blizzard command was used and then its the case of checking whether it had been changed and in what way so that your addon can then be adjusted so that it will work again.

I don't use xml files myself but here's an example of what could be happening with xml files if Blizzard changed anything there:

Code:
	<Button name="MyButtonTemplate" virtual="true" hidden="true">
		<Size><AbsDimension x="174" y="16" /></Size>		
		<Layers>
			<Layer level="BACKGROUND">
				<FontString name="$parent_EntryText" inherits="GameFontHighlightSmall" justifyH="LEFT">
					<Size><AbsDimension x="174" y="16" /></Size>
					<Anchors><Anchor point="LEFT"><Offset><AbsDimension x="2"/></Offset></Anchor></Anchors>
				</FontString>
			</Layer>
		</Layers>

		<PushedTexture file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
			<TexCoords left="0.15" right="0.25" top="0.0" bottom="0.6"/>
		</PushedTexture>
		<HighlightTexture file="Interface\HelpFrame\HelpFrameButton-Highlight" alphaMode="ADD">
			<TexCoords left="0.05" right="0.07" top="0.1" bottom="0.5"/>
		</HighlightTexture>
		<Scripts>
			<OnClick>
				MyButton_OnClick();
			</OnClick>
		</Scripts>
	</Button>
In this instance if Blizzard changed Button to say PushButton or OnClick to OnPush then this could be what would cause a break in the addon.

I hope that helps you a bit better. When I first started I had a hell of a time figuring things out and I have a programming background. I can only imagine how confusing it is for someone that hasn't programmed before.
__________________
  Reply With Quote
06-29-09, 04:59 PM   #5
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Thank you Xrystal, things are becoming *clearer* just all the pieces haven't fallen into place for me yet, but I can see more pieces of the puzzle so to speak. The examples helped greatly... while I've looked at a few .toc files myself (especially back in the day pre-tbc when we were all using Cosmos and had to update the toc "Interface: ####" ourselves... I know you guys remember!) I generally never understood what I was looking at past the first block of comments (Everying past "## SavedVariables").

Correct me if I'm wrong... but that first code snippet looks a lot similiar to VisualBasic.... meaning "if <this> then <this> otherwise do <this>". Which of course makes that part of the code easier for me to look at and 'tweak' as I used to know VB2 (yes, old school) and while I refuse to claim any sort of "programming background" it does help in it's way.

Let me ask you though (and since PTR is down I cannot give more detail, I'm sorry), when I last logged into the PTR, I had bugsack throw some errors my way, on addons I don't use anyway. Since I'm trying to work out FuBar, I shifted through BugSack but never saw any error code for FuBar... what would you do if your addon was not working on PTR and you had no errors in BugSack or similiar addon?

Somone in another forum told me to not work on an addon that was broken, but the way I see it thats exactly what I do want to do... how do you learn to fix something not broken?
__________________
  Reply With Quote
06-29-09, 06:04 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I read your thread on wowace. What xbeeps is trying to tell you is that FuBar (broken, at that) is not the best project for you to be starting with because of the nature of it. While some people would argue that jumping into the deep end of the pool is a great way to learn to swim, this is like jumping into the deep end of a wave pool with heavy clothes on and one arm tied behind your back. Impossible? Probably not. A great experience? No.

Since you're not listing what errors you *are* getting in BugSack, I can only guess what the problem is. Another addon is interfering with FuBar, a library error is causing it to fail to load, etc etc.

I second what xbeeps said to you. Take a simple, working addon and try to add to it or change it in some way. If you go with this approach, you
  • are dealing with working code to learn from
  • know when it errors that it's something you did
  • are able to go bit by bit, understanding chunk by chunk
Besides... How will you know what to fix and how, if you don't know *why* it's broken and how the original code was derived?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-29-09, 06:23 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
As seerah has pointed out a broken addon is not a good way to learn how to work with lua and xml to make wow addons ( or at some point fix them ). The hello world example in wowwiki is a simple starter project but has been said look for an addon that has minimal functionality that works and try to expand on it in some way. Even if its to display something in a different color or position it in a different place. Those sort of things you will end up doing in one form or another so good to learn exactly how you can do that.

In light of the errors you are currently getting on the PTR I would suggest you disable every addon except the fubar one and one of its plugins. And if that plugin needs the addon itself to work then that too. If that still errors out then the bugsack should tell you how and where it is ending up and you can track it back to its source which may or may not be in the addon itself or fubar.

If you post up an example error you are getting then maybe we can highlight what you need to identify to track it down further.
__________________
  Reply With Quote
06-29-09, 06:29 PM   #8
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Of course, you're probably right Seerah, as well as xbeeps.. just too stubborn sometimes and too anxious to jump in I guess. The main reason I persisted with FuBar, even after xbeeps informed me that it was more intricate than I thought, was mainly because I was trying to figure out the error and fix it. I know what you mean about how can you fix something without understanding the problem, but I was trying work at it backwards... figure out how to fix anything that breaks, and then learn why.

With that said though, me really not knowing the programming language then I'm going to wisely find another addon and work from a different approach... learn the programming aspect before the fixing. I just was apprehensive to do that without first knowing how to fix it (ie. make it compatible for future patches).

As for not posting any errors... I had tried to get back in the PTR today to see if I could get something outta bugsack, but the servers were down. I will keep an eye on when they come back up and see if I can drop some errors for it.

I've over 80 addons, and honestly not quite sure how you determine what is a "simple" addon and what is not. I figured FuBar would be one of the more simple ones, as it just is a panel with functions to allow other addons to 'plugin' to it. Once I figure out what a more simple addon is or how to determine a simple from complex, I'll work on adding something to it etc. However, I'll still run into the problem of what happens when it becomes uncompatible and 'breaks', how to fix it.
__________________
  Reply With Quote
06-29-09, 06:37 PM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
If an addon contains a single file ( not including localization and toc files ) that has less than 100 lines then thats a good one to go for or something similarly short.

If it has 1 or 2 frames of display then its worth checking out.

For the moment you might want to steer clear of any Ace based addons as well as titan, fubar, data broker, ldb type bar display addons as they are deceptively small but you will probably find they have more involved than is visually seen.

I'd suggest a couple of my own ones but they are pure lua without a hint of xml which may not be what you want to deal with as xml files can help display things easier and leave the lua files for functionality.
__________________

Last edited by Xrystal : 06-29-09 at 06:41 PM.
  Reply With Quote
06-29-09, 06:55 PM   #10
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Originally Posted by Xrystal View Post

For the moment you might want to steer clear of any Ace based addons as well as titan, fubar, data broker, ldb type bar display addons
LOL Almost all of my addons are Ace based.... I think you just eliminated about 95% of my addons.

I will however look at the addons you have out, see if I have any and work from there, using the WoW Programming book as a reference guide... I'm just not sure where to begin with adding functions to it... more of like I'm not sure what to add lol
__________________
  Reply With Quote
06-29-09, 07:02 PM   #11
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
rofl, it was a learning curve I can tell you. My first addon was a simple one from the wowwiki site itself and is probably in that book somewhere.

Its just a small window that displays your gold balance and keeps it updated. Simple, but it introduces you to how events work and displaying items on the screen and positioning them. It wasn't until I started looking into modifying nUI to work with what I want that I delved further.

If you do decide to delve into one of mine you might want to look at TotemDeathWatcher and CatchAndThrow. They are my simplest ones but will only work for a shaman ( the former ) and if you have an item you can throw to someone and back ( the latter ). Both deal with events and displays messages or images on the screen. However I do use my own functions for the display but you should be able to see what the official functions are for it so you can in essence practice by removing my functions from the addon and replacing it with the blizz official functions directly. Loot Alerter is my biggest one and may be awhile before you want to delve into that lot And then you have the nUI based ones which would be useless to you except to look at my comments to the code I have there unless you have nUI yourself.

Actually you may be better off using my initial download of LootAlerter as that was before I did all the massive private functions. Its less than 400 lines (just) and is full of comments. So if anything try 1.01.00 of Loot Alerter and see where that takes you. Then you can see what I added at each update to make the addon grow.
__________________

Last edited by Xrystal : 06-29-09 at 07:05 PM.
  Reply With Quote
06-29-09, 07:59 PM   #12
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Sounds like a winner to me ^^ I have already looked at the addons you have, and you're right... nUI is useless to me as I don't use it (although, I may just to clean up my GUI and make it all more compact) but I was already looking at LootAlert but accidently pulled up latest version... thanks for the tip about the older version ;-)
__________________
  Reply With Quote
06-29-09, 08:06 PM   #13
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
good luck Its very addicting once you get started .. at least it is for me. I keep looking for new addons to create .. rofl
__________________
  Reply With Quote
06-29-09, 08:08 PM   #14
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Oh I'm sure it is at that... I've a very addicting personality lol. My long run hope is to either keep all my addons up to date without having to depend on others' time schedules, or just make my own full UI like nUI or something
__________________
  Reply With Quote
06-29-09, 08:08 PM   #15
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by chanceibmny View Post
What I'm trying to find out is: How do you update an addon to be compatible with the current WoW release?
if only it was just a matter of updating a TOC...

if Blizzard has engaged in undocumented changes to stuff that you use (Aloft, for instance, has to understand at runtime how Blizzard default nameplates plug together at the "frame" level, and this changed slightly in 3.2, but in a way that completely broke Aloft), you have to do some testing, reverse-engineer the changes, and modify/re-test your addon accordingly.

generally speaking, this can be anything from a trivial "annoyance" to a major pain. in this particular case, it required a couple hours of work (it looked worse that it actually turned out to be).

WoW, viewed as a "programming environment", is not subject to the same sort of standards of documentation and feature evolution that govern something like a major release of Java (or any other "major software product")... it is more like an early-generation open source project (potentially in constant flux, almost solely community-supported and community-documented, but without the option of retaining an older revision for the sake of stability; all the ships are more-or-less completely burned on every release, and you may have to rebuild).

to detect, in LUA, what version of the WoW client you are running under, take a look at GetBuildInfo().
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote
06-29-09, 08:29 PM   #16
Tearstar
A Cyclonian
 
Tearstar's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 42
What I did was took a small standalone addon (meaning not a part of a collection) that did one or two things I liked, for instance YouWereKilledBy (just an example but tthe addon exists), it's outdated yes, but I looked through the code to learn the structure and elements then started researching the newer stuff on wowwiki while looking at the old code, I first got the old outdated mod to the point that it worked on the current build and then used what I had learned from looking at the old code, learning the new code and then developed my own addon.

I don't see the problem with learning from an existing addons code, as long as your not duplicating the code as your own, sometimes just one line of "duplicate" code could be your downfall, highly unlikely but worst case scenerio. You can check out one of mine, they are both simple, the main addon is both lua and xml, the plug-in tho is pure lua, see what they do, where and how . . . then yes check wowwiki and your book for newer, better, less spaghetti code, learn as you develop something small, then take on your own project with what you have learned. I love it and just keep getting deeper and deeper into the code and learning all about it.

I too knew a good bit of HTML and other web languages you should be able to pick it up fairly quickly and easily, especially if your like me and self taught on the web design

anyway good luck and hope to see "author" by your name soon
__________________
Author of Mini-Targ

Magelo Profile
My Myspace
My Youtube Channel

My First Video I made for my kids - please comment and/or rate

  Reply With Quote
06-29-09, 10:01 PM   #17
chanceibmny
An Aku'mai Servant
 
chanceibmny's Avatar
Join Date: Apr 2006
Posts: 39
Thank you Tearstar ^.^ I would never consider "ripping" another author's work and pushing it as my own... its just dirty and wouldn't want that done to me.

You're pretty much right on the nose of what I had started out to do... find something that doesnt work and teach myself the structure and how to make 'em work and then branch off to write my own from scratch. Good advice and I'll check out your addons as well as a few others out here ^^

I, too, am purely self taught (with cross checking other sites/guides) for web design and languages ;-)

One of these days, I'll hit up all 3 forums I've posted this question in and hopefully get a sticky out there for other hopeful future authors that run along the same hurdles ;-)

Thank you to everyone who has replied (and for those of you who have more to add, please do so!) and anyone who may reply in the future with helpful knowledge, thank you!
__________________
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Updating addons to current patch..

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off