Questie

Questie

116M Downloads

Quest Item tooltip error.

rasberryrabbit opened this issue ยท 16 comments

commented

Questie raise error on tooltip on quest item when item withdraw from bank.

How to make this error,

  1. Store quest item in bank.
  2. withdraw from bank and mouse over quest item.
  3. Get error in QuestieNotes.lua line 396.

I changed in QuestieNotes.lua line 395,

                            if QuestieHandledQuests[k] then --< CHANGED
							local logid = Questie:GetQuestIdFromHash(k);
							QSelect_QuestLogEntry(logid);
							local desc, typ, done = QGet_QuestLogLeaderBoard(m[1]['objectiveid']);
							local indx = findLast(desc, ":");
							local countstr = string.sub(desc, indx+2);
							--GameTooltip:AddLine("   " .. name .. ": " .. countstr, 1, 1, 0.2)
							Questie_TooltipCache[cacheKey]['lines'][lineIndex+1] = {
								['color'] = {1, 1, 0.2},
								['data'] = "   " .. name .. ": " .. countstr
							};
							Questie_TooltipCache[cacheKey]['lineCount'] = lineIndex + 2;
							p = true;
							mi = true;
                            end --<  CHANGED
commented

Now THAT is a proper bug report! LOVE IT!

And it actually makes perfect sense since the tooltip code has been changed as well. I'll have to review all these sub-dependencies to make sure nothing else needs fixing.

This is Aero's show now so I'll have to defer to him when this fix will make it into the next release.

commented

Sorry. my code change don't work properly. It makes another error. I will do more investigation on it.

(edit) update new code on QuestieNotes.lua

commented

Now that I'm actually home and looking over the code... yeah, there is something else going on. I'm going to try and repro this and see if I can't track down the issue. Might be a client side issue with the item being cached in certain containers Bank Slots vs Bag Slots.

Is it possible to provide a screenshot of the actual error? Or use Improved Error Frame to capture a debug stack?

commented

I'm not able to repro this error. A bunch of tooltip errors and issues were resolved with the latest release... did you try that?

I'll need a screen shot of the error or a text dump of the error message.

commented

It's rare error on elysium. My second code also didn't work. I make new code for testing.

function Questie:GetQuestIdFromHash(questHash)
local numEntries, numQuests = GetNumQuestLogEntries();
if(numEntries ~= LastNrOfEntries or not CachedIds[questHash]) then
CachedIds = {};
LastNrOfEntries = numEntries;
Questie:UpdateQuestIds();
if CachedIds[questHash] then
return CachedIds[questHash];
else
-- infinite recursive call? --<< CHANGED
local logid = Questie:GetQuestIdFromHash(questHash)
return logid
end
else
local q, level, questTag, isHeader, isCollapsed, isComplete = QGet_QuestLogTitle(CachedIds[questHash]);
QSelect_QuestLogEntry(CachedIds[questHash]);
local questText, objectiveText = QGet_QuestLogQuestText();
if(q and level and objectiveText) then
if(Questie:getQuestHash(q, level, objectiveText) == questHash) then
return CachedIds[questHash];
else
Questie:debug_Print("[GetQuestIdFromHash] Something went wrong Error1");
end
else
Questie:debug_Print("[GetQuestIdFromHash] Something went wrong, Error2", tostring(CachedIds[questHash]), tostring(q), tostring(level));
end
end
end

commented

Line 407 through 410 in QuestieNotes.lua

--GameTooltip:AddLine(v['objectives']['QuestName'], 0.2, 1, 0.3)
--local logid = Questie:GetQuestIdFromHash(k);
--QSelect_QuestLogEntry(logid);
local desc, typ, done = QGet_QuestLogLeaderBoard(m[1]['objectiveid']);

Comment out lines 408 and 409

commented

Never mind... don't do that. Not a good idea.

This is a really weird bug. Why this item specifically? I haven't encountered this issue in any other quest. Luckily I have a character that is about the right level. I'll run up to Loch Modan and get that quest. I have a theory as to what is causing it but I need to confirm it first by repro'ing this issue.

commented

OK, going back to the original error. "Error: Usage: SelectQuestLogEntry(index)" - in short this is a nil error because it's not finding the quest index. All the other tooltip loops have checks to see if 'logid' is present and not nil before running the rest of the loop. Otherwise it simply skips that block and continues on. Here is what I did to fix it... beginning with Line 401 in QuestieNotes.lua

if(QuestieItems[objective]) then
	local lineIndex = Questie_TooltipCache[cacheKey]['lineCount'];
	Questie_TooltipCache[cacheKey]['lines'][lineIndex] = {
		['color'] = {0.2, 1, 0.3},
		['data'] = v['objectives']['QuestName']
	};
	--GameTooltip:AddLine(v['objectives']['QuestName'], 0.2, 1, 0.3)
	local logid = Questie:GetQuestIdFromHash(k);
	if logid then
		QSelect_QuestLogEntry(logid);
		local desc, typ, done = QGet_QuestLogLeaderBoard(m[1]['objectiveid']);
		local indx = findLast(desc, ":");
		local countstr = string.sub(desc, indx+2);
		--GameTooltip:AddLine("   " .. name .. ": " .. countstr, 1, 1, 0.2)
		Questie_TooltipCache[cacheKey]['lines'][lineIndex+1] = {
			['color'] = {1, 1, 0.2},
			['data'] = "   " .. name .. ": " .. countstr
		};
		Questie_TooltipCache[cacheKey]['lineCount'] = lineIndex + 2;
		mi = true;
		return;
	end
end

I've attached QuestNotes.lua.txt (remove .txt from the file before using) to my post to make it easier.

QuestieNotes.lua.txt

Please test and report back. If this resolves your issue then I can have Aero include this fix in the next build.

commented

I tested new Questie 3.5 and I got different error.

item_tooltip_error

100% generate this error,

itemtooltip_error_regenerate

  1. At loc modan, get blood sausage quest
  2. and got Spider Ichor
  3. go to westfall, open bag and mouse over 'Spider ichor'

and I got result with my lastest patch

  1. questie 3.3 + my patch = works
  2. questie 3.5 + my patch = not works.

tooltip_patch_3_3.patch.txt

commented

I think this bug caused by WoW client addon API bug and a not addon problem.
And I tested "if logid then" clause on previous questie 3.3, tooltip doesn't showed on quest item.

Sometimes my lastest patch with 3.3 raise stackoverflow, I renew patch on questie 3.3.

tooltip_patch_3_3_loop.patch.txt

commented

Interesting... but you can't use QExpand_QuestHeader(0) like you have in your code. You can use ExpandQuestHeader(0) because that is an actual Blizzard API call so it's valid. You'd have to define QExpand_QuestHeader like we have done for other Blizzard API's. For example...

---------------------------------------------------------------------------------------------------
-- WoW Functions --PERFORMANCE CHANGE--
---------------------------------------------------------------------------------------------------
local QGet_QuestLogTitle = GetQuestLogTitle;
local QGet_NumQuestLeaderBoards = GetNumQuestLeaderBoards;
local QSelect_QuestLogEntry = SelectQuestLogEntry;
local QGet_QuestLogLeaderBoard = GetQuestLogLeaderBoard;
local QGet_QuestLogQuestText = GetQuestLogQuestText;
---------------------------------------------------------------------------------------------------

So in the above section, you'll find it near the top of QuestieQuest.lua, you'd want to insert another line...

local QExpand_QuestHeader = ExpandQuestHeader;

Only then will the above code example work.

commented

Yep, I forgot it. Sorry. I fixed it.

commented

I found what cause this.
if quest header is collapsed, sub-quest is not listed with "GetNumQuestLogEntries".
I insert "ExpandQuestHeader(0)" at first line of "Questie:UpdateQuestIds()" function and it solves problem.

...
local QExpand_QuestHeader = ExpandQuestHeader;
...
function Questie:UpdateQuestIds()
local startTime = GetTime()
-- expand all quest header first, quest is not enlisted if header is collapsed
QExpand_QuestHeader(0)
local numEntries, numQuests = GetNumQuestLogEntries();
for i = 1, numEntries do
local q, level, questTag, isHeader, isCollapsed, isComplete = QGet_QuestLogTitle(i);
if not isHeader then
QSelect_QuestLogEntry(i);
local questText, objectiveText = QGet_QuestLogQuestText();
local hash = Questie:getQuestHash(q, level, objectiveText);
if(not q or not level or not objective) then
Questie:debug_Print("[UpdateQuestID] ERROR!!!! Error1",tostring(name), tostring(level), tostring(i), tostring(hash))
end
CachedIds[hash] = i;
end
end
Questie:debug_Print("[UpdateQuestID] Had to update UpdateQuestIds",(GetTime() - startTime)*1000,"ms")
end

commented

@rasberryrabbit
I checked in some code that should fix this issue. I was trying to reproduce the error you were getting while using EQL3 which doesn't allow the Zones to be collapsed. I also fixed the Quest Items tooltips so they should now be visible. I spent some time last night running the Default WoW Quest Log and Tracker to make sure nothing else was broken. We don't have an "official" release with all these fixes out yet but all the code has been checked in.

You can go here: https://github.com/AeroScripts/QuestieDev then click the green "Clone or Download" button and select Download Zip. This will download the whole repository so you'll have to manually copy the files over but I'm sure you can do that. :)

commented

Actually, interesting thing. I was having this problem. Yes, if the quest headers were collapsed, the tooltip gave the "SelectQuestLogEntry" error.

I installed the fix above, and the first error is resolved. But now the tooltip rapidly flickers between the Questie tooltip (With quest info embedded) and the "original" tooltip item.

Thoughts?

commented

Flickering is maybe different problem. I fine with tooltip. I have making another method of this problem.