Quantcast Updating addons to current patch.. - WoWInterface
 
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,447
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,447
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,727
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, 08:08 PM   #7
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

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