ckknight's Avatar
Files 15
Downloads 2,900,343
Favorites 15,120
View Bug Report
Problem with BabbleSpell:GetLocalized
Bug #: 1356
File: FuBar 3.6.5
Date: 06-07-06 02:07 PM
By: Xplosionist
Status: Unconfirmed
In AnkhTimerFu, it tries to determine if the character has the Improved Reincarnation talent. It uses Babble-1.0, and calls GetLocalizedSpell(IMPROVED_REINCARNATION). This returns a null, and some code analysis of BabbleSpell:GetLocalized() shows that it appears to be recieving a null as its parameter. But I can't figure out why.

I changed AnkhTimerFu to load Babble Interface "Spell 1.1" to see if that would make a diff., but it doesn't. I looked at some other Fu modules, and saw them using strings, so I changed it to call GetLocalized("IMPROVED_REINCARNATION"). However, GetLocalized() still reports (when I add extra code to check the arg) that it's getting a NULL.

This is *probabaly* a user error, but I can't figure out what the calling interface to GetLocalized() is. What am I doing wrong?

Thanks.

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: ckknight - 06-07-06 08:19 PM
/print BabbleLib:GetInstance("1.1"):GetLocalized("IMPROVED_REINCARNATION")
Improved Reincarnation

hrm. Works that way.

Also, I've been working on BabbleLib 1.2 which you may want to upgrade to. Here's the new API:

local S = BabbleLib:GetInstance("Spell 1.2")
print(S"Improved Reincarnation") -- will print out the translation in the local language. ;-)
By: Xplosionist - 06-08-06 08:51 AM
Bizarre. Okay, it looks like a problem with me trying to change too many things at once. The original code was:

babble = BabbleLib:GetInstance("1.0");
name = babble.GetLocalizedSpell(IMPROVED_REINCARNATION);

That was failing. I apparently changed it to:

babbleSpell = BabbleLib:GetInstance("Spell 1.1");
name = babbleSpell.GetLocalized("IMPROVED_REINCARNATION");

which also failed. It seems that either:

babble = BabbleLib:GetInstance("1.0");
name = babble.GetLocalizedSpell("IMPROVED_REINCARNATION");

*or*

babbleSpell = BabbleLib:GetInstance("Spell 1.1");
name = babbleSpell:GetLocalized("IMPROVED_REINCARNATION");

*do* work however. Note that in the 1.0 instance, it uses "babble.GetLocalizedSpell", and in the "Spell 1.1" version, it must use "babbleSpell:GetLocalized", but parses and fails to work with "babbleSpell.GetLocalized".

I clearly don't understand enough about the language or gammar of LUA. But. As you note, your test above works. And if I did:

/print BabbleLib:GetInstance("1.0"):GetLocalizedSpell("IMPROVED_REINCARNATION")

it also worked. It was after that test that I tried using a ':' instead of the '.', which fixed it. (*shrug*)

Thanks for your help. The first solution (just quoting the arg, still using instance 1.0 code) works, and will be fixed in the source.