ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   QuestInfo Bug (https://www.esoui.com/forums/showthread.php?t=5054)

@AlphaLemming 08/26/15 04:34 AM

QuestInfo Bug
 
Did anyone encounter this too?

GetJournalQuestInfo(questId) returns a empty array if on a german client and has crafting quest Alchemy writ with completed steps?

votan 08/26/15 04:44 AM

Quote:

Originally Posted by @AlphaLemming (Post 22961)
Did anyone encounter this too?

GetJournalQuestInfo(questId) returns a empty array if on a german client and has crafting quest Alchemy writ with completed steps?

Yes. Wandamey figured out how it's correct:
Lua Code:
  1. for questIndex = 1, MAX_JOURNAL_QUESTS do
  2.     if IsValidQuestIndex(questIndex) then
  3.       questType = GetJournalQuestType(questIndex)
  4. ...
Because the questIndex does not change, if you complete another quest with a lower index.

merlight 08/26/15 04:50 AM

Uh, so when I'm iterating for i = 1, GetNumJournalQuests() I'm doing it wrong? Because that function returns the number of active quests, but they can be index 5, 7 and 13? :confused:

Fyrakin 08/26/15 04:53 AM

Quote:

Originally Posted by merlight (Post 22963)
Uh, so when I'm iterating for i = 1, GetNumJournalQuests() I'm doing it wrong? Because that function returns the number of active quests, but they can be index 5, 7 and 13? :confused:

Quest index is not a quest ID. It is just an order representation number for the stock quest tool. So, you have to check the number if its valid before doing anything else.

votan 08/26/15 04:56 AM

Quote:

Originally Posted by merlight (Post 22963)
Uh, so when I'm iterating for i = 1, GetNumJournalQuests() I'm doing it wrong? Because that function returns the number of active quests, but they can be index 5, 7 and 13? :confused:

Yes. That was a trap in Potion Maker. It was reported, that the writ potion was not found. After Wandamey told me, that the index does not change and I should use MAX_JOURNAL_QUESTS, I found that IsValidQuestIndex function in ESO code.

Wandamey 08/26/15 05:24 AM



Apparently the only purpose of GetNumJournalQuests is to display that "Quests : num/25"

but the indexes change as soon as you complete a new step of any quest i think (i didn't exactly figured that one), which made this hard to detect. (not to mention that getting no nil error when iterating an empty array is a bit counterintuitive)

I found an even easier way to iterate recently but never used it and i didn't keep the test, maybe something along getnextquest. But anyway, it's just a 25 lines array.

@AlphaLemming 08/26/15 05:41 AM

What a mess, thanks all for the informations!

Fyrakin 08/26/15 05:48 AM

That was the main reason why I had to fix MiniMap quest pin updates so many times :)

circonian 08/27/15 09:00 PM

What about QUEST_TRACKER.tracked, can't you just loop through it to get the quest indices? Every quest appears to be added to it. Although there is a function to remove a quest from the tracker
Lua Code:
  1. ZO_Tracker:SetTracked(questIndex, tracked)
it doesn't look like its used. There are a few checks to call it & remove a quest from the tracker if QUEST_TRACKER:IsFull(), but since:
Lua Code:
  1. tracker.MAX_TRACKED = MAX_JOURNAL_QUESTS
I don't see how that would ever happen, unless some addon manually removed a quest from the tracker.


All times are GMT -6. The time now is 10:35 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI