Wednesday 15 March 2006

The Parexel six — plus two

The story of the six men who have been involved in the trial of an anti-inflammatory drug and have come down with severe reactions flashed across the news last night. Reading between the lines, though it was not specifically said, there could be much worse news to come. The men have multiple organ failure and unless that can be reversed quickly — and I'm guessing it may already too late — they are going to die. But I find myself thinking also of what the article mentions in almost an aside: a further two men had been given a placebo. What must those two men be thinking and feeling now? Fear? Relief? Guilt? Will their lives change? Will they ever offer themselves for drugs trials again? Update: 16 March: Further reporting on the BBC website has one of these two saying:
They "went down like dominoes", according to Raste Khan, 23, one of two trial volunteers who escaped unscathed after being given a placebo. He told the Sun newspaper: "They began tearing their shirts off complaining of fever, then some screamed out that their heads felt like they were going to explode. "It was terrifying because I kept expecting it to happen to me at any moment. But I felt fine and I didn't know why."

Saturday 4 March 2006

Quick tip for Warlocks

If you have Master Demonologist then summon an Imp before summoning your Felsteed: the combination of Blood Pact for extra stamina and 20% reduced threat from Master Demonologist is ideal for galloping through hostile countryside without getting knocked off your horse.

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!