Showing posts with label Ged's Guides. Show all posts
Showing posts with label Ged's Guides. Show all posts

Saturday, 18 February 2006

Addon progress

I'm getting more used to lua, though I still find it a bit odd. It seems to be reasonably orthogonal, which is nice. This means you have ways to indicate default arguments that don't involve hacks to the language. For example, if I want to indicate to a function that its should default to inspecting the currently selected player, npc or mob I can tell it to default to "target" by writing:


function myFunc( unit )

 unit = unit or "target"
 -- more code goes here...

end

I've managed to get most of the information I want regarding beasts, and very interesting the trawl has been too. The only thing I don't seem to be able to get is the beast's dietary requirements. Now that must be available since the beast lore UI, the stable UI and the pet UI all display it; however it doesn't seem to be referenced anywhere. I've put a question in a forum, maybe I'll get a response from that.

Thursday, 16 February 2006

My first WoW addon

So last night I decided I needed to start addon development. Long-term I want to be able to feed stats to wow.gedsguides.com's database (just like the big boys, lol). Short-term, I thought, something that will capture the results of a Beast Lore on a selected beast and write it to a file. It doesn't need a UI: just a function that's callable from a macro will do. Extremely simple, you'd think.

The first step was to read up the tutorials on the web (ouch! they are out of date!) and do a little teensy application that just put up a message box on entry to the game. Which stopped working as soon as I moved the body of the script out of the xml file into the lua file: I kept on getting an error about trying to call a global that was nil. I'd moved from having a ggwmain.xml that said:


<Script>
 message("Ged's Guide to World of Warcraft!!");
</Script>

to a ggwmain.xml that said:


<Script file="ggwmain.lua"/>
<Script>
 GGW_SayHello();
</Script>

plus a ggwmain.lua that contained:


function GGW_SayHello()
 message("Ged's Guide to World of Warcraft!!");
end

I googled the text of the error message, and found dozens of complaints from addon users that their addons had stopped working with the release of patch 1.9 of WoW, but no answers that would indicate a cause except for vague protestations by the addon writers that something must be wrong with the users' installations. Duh!

Assuming that the "global" referred to was the name of the function in the lua file referenced in the xml file, the error message was obviously saying it couldn't find it. Which meant that the lua file probably wasn't being loaded. Hmm, I remembered that the original article had been insistent about its main xml file and its main lua file having filenames identical to that of the addon directory. So my addon being directory being "AddOns/GGW" I changed the xmlfile to "GGW.xml" and the lua file to "GGW.lua", updated the reference to the lua file in the xml file, updated the reference to the xml file in the toc (table of contents) file, quit WoW and relaunched it.

It worked straight away. How very disappointing. Little rules like that are like a red rag to a bull for me: if you have to make the filenames identical, then why is it necessary to specify them? If your main lua file has to be called addonname.lua then shy do you have to specify in the xml file that it's called addonname.lua? If your xml file has to be called addonname.xml then why do you have to specify addonname.xm in the toc file? It's redundant!

So this morning I decided to backtrack and find out where it would break. Firstly I renamed the lua file back to ggwmain.lua and updated the reference in the xml file. Started WoW. It still worked. So it must be the xml file! With trembling hands, I renamed the xml file to prue.xml and updated the toc file. Quit WoW. Restarted it. It still worked!

So now I have no explanation for the original failure. Eek!

Sunday, 18 December 2005

Google: your site is indexed for our purposes, but not for yours

Google can be intensely annoying (but I love you really!) . I've just added Google SiteSearch and Google AdSense to wow.gedsguides.com; the SiteSearch to double as a poor man's full-text index of the site, so that users don't have to rely on quest titles to find the quests they want, and the AdSense so that one day the site might make me a little money. Guess which one is working?

Correct! AdSense has been delivering targetted ads since about 24 hours after the site went live (with about 300 virtual pages worth of content). And those ads are not only targetted in a general sense towards World of Warcraft™, they also occasionally seem to be picking up on themes specific to a particular page. For example, a page detailing a quest where you have to kill wolves just now gave me five ads themed around the word "wolves".

That means they must have thoroughly indexed the site. But if I go to the SiteSearch box and enter the word "wolves" with the search option restricted to "This Site", I get nothing on the results page. Except a couple more themed ads. If they run true to form, the site won't appear in their results for a month or more. Even though they already have all the data they need.

Grrrrr!!!!!

Wednesday, 14 December 2005

Ged's Guide to World of Warcraft goes live!

Things seem to have moved at unprecedented speed, especially given the fact that I'm ill with a leg ulcer at the moment, but my new World of Warcraft quest guides site has just gone live at Ged's Guide to World of Warcraft.

In truth it's not nearly finished yet, but it's useable and the basic functionality is there so there's no reason why people shouldn't be able to use it and, I hope, have their enjoyment of the game increased, however slightly. I'm hoping that by releasing it early I can get feedback from users that will prevent me from making mistakes I might have made and allow me to do things I might never have thought of.

It turned out that the folks at positiveinternet didn't move quickly enough for whatever reason, and so the site is currently hosted, albeit on a monthly rolling contract, by the good folks at jsp-servlet.net.

It's not that easy to get a hosting provider that knows what they are doing with Java technology, certainly at the cheap end of the market, and I spent a lot of time looking at the various offerings. Many seem to focus on jsps rather than servlets, and a common theme is that you can only have a single web app deployed, which goes into the root of your home directory. That just doesn't seem acceptable to me for anything other than the most trivial site. For a start, I'd never even consider putting any maintenance or management functions into the public web application either, so the most likely motif would be a pair of web apps for each game supported, along the lines of /wow and /wow-admin. And if gedsguides.com ever takes off, it will end up catering to more than one gaming community, so there's scope for several WAR deployments right there. Although I expect that by that time we'd actually have moved to at least a virtual private server if not a dedicated box, so the argument becomes a little moot.

As well as the aptness of the facilities offered, there's also the question of the currency of the software supported, and here also standards generally seem to have been lamentable. Certainly much more than half of the jsp/servlet-aware hosters I found were offering Tomcat 4.x instead of 5.x, and I think that that is just not on, two years or so after servlet 2.4 and jsp 1.2 came out. Again, about half were using JDK 1.4.x instead of 1.5.x. It's obvious that for most providers, it's a question of offering whatever is current on the Linux distribution they chose for their OS, and this means that while their PHP support is relatively up to date, their jsp/servlet support is relatively out of date. That's a shame, but I suppose it does increase the size of the niche market enjoyed by the java support specialists.

Time to stop rambling and get coding.