ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Daily enchanting writ returns (type=none)(name=empty string) (https://www.esoui.com/forums/showthread.php?t=10590)

sinnereso 06/02/23 08:11 AM

Daily enchanting writ returns (type=none)(name=empty string)
 
I was doing some writs and noticed my compatibility mod I made for my addon for dailys wasn't functioning so I did some digging and discovered:

Code:

CRAFTING
    Enchanter Writ
          craft supurb glyoh of health with ta
          aquire jehade potency rune

returns QUEST_TYPE_NONE and crafting name = [empty string] so I can't even filter it out by name if I wanted to. Seems like a bug to me so I'm reporting it. I suspect its not the only one like this.

IMO since it is in the CRAFTING section of the quest journal with all the other "QUEST_TYPE_CRAFTING" daily writs AND literally says "craft a supurb glyph...", that it should also be considered a "QUEST_TYPE_CRAFTING" quest and all the others with a similar problem.

Baertram 06/02/23 10:50 AM

What API functions do you refer to please if you say "it returns", and the values are wrong/nil/empty?
Any GetQuest* API?

Mentioning your addon is not enough for a bug report. Please provide an exemple code to run to see that bug and also test it with all addons disabled to see if it really is a bug, or an addon created bug.
Thank you

sinnereso 06/02/23 01:21 PM

sorry heres the entire function.

Code:

function MyAddon.HasWritQuest()-- << CHECK FOR ACTIVE WRITS
        for quest=1, GetNumJournalQuests() do
                if GetJournalQuestType(quest) == QUEST_TYPE_CRAFTING then return true end
                --df(tostring(GetJournalQuestType(quest)))
                --df(tostring(GetJournalQuestName(quest)))
        end
        return false
end

df(tostring(GetJournalQuestType(quest))) returns QUEST_TYPE_NONE
and
df(tostring(GetJournalQuestName(quest))) returns [Empty String]

for that particular quest.. the remaining quests in my journal return properly as normal.

Baertram 06/03/23 03:24 AM

What client language do you use, is it English?
I remember there was something with French e.g.

And what does GetJournalQuestName return for that quest?

sinnereso 06/03/23 05:24 AM

Quote:

Originally Posted by Baertram (Post 47864)
What client language do you use, is it English?
I remember there was something with French e.g.

And what does GetJournalQuestName return for that quest?

yes its the english client and GetJournalQuestName returns "[Empty String]"

**EDIT
Just checked todays writs and they're fine. all returning QUEST_TYPE_CRAFTING and correct names..But yesterdays enchanting was not.

Calamath 06/03/23 11:46 AM

It is not a bug, you should peruse this thread first. ;)

- Calamath

sinnereso 06/03/23 01:06 PM

Quote:

Originally Posted by Calamath (Post 47866)
It is not a bug, you should peruse this thread first. ;)

- Calamath

I checked it out and asside from what appears to be many assumtions there it doesnt match my scenario. I only had the daily writs quests in my journal which equalled 7 not 10 and today I can repeat the process 100x and its fine but yesterday ONLY the enchanting writ quest which was the 5th index value at the time was returning QUEST_TYPE_NONE and name [empty string] repeatedly. today repeatedly the enchanting writ is fine with the exact same number of quests in my journal. Today is a different enchanting writ tho so ill be watching for that same one to return to compare results once again.

Calamath 06/03/23 01:55 PM

You didn't get the point of the thread, so I'll copy and paste. :(

You should use the global constant MAX_JOURNAL_QUESTS (=25) instead as the loop count.
And for each index, you need to check if it is valid or not.

This is really hard for me to say, the bug is in your code.

- Calamath

sinnereso 06/03/23 04:09 PM

Quote:

Originally Posted by Calamath (Post 47868)
You didn't get the point of the thread, so I'll copy and paste. :(

You should use the global constant MAX_JOURNAL_QUESTS (=25) instead as the loop count.
And for each index, you need to check if it is valid or not.

This is really hard for me to say, the bug is in your code.

- Calamath

ok ill give it a whirl.

Sharlikran 06/03/23 06:49 PM

Not to mention that Crafting Quests may not be quests that involve crafting. It is probably the certification quests.

Ignore the classification you want and get the quest data ZOS provides using GetJournalQuestType(). See how ZOS classifies them. Irrespective of how you think they should be classified, their classification is what ZOS chose.You may not be able to filter writ quests you don't want by the quest type "crafting" because they are probably daily quests.

Dolgubon 06/03/23 09:35 PM

Here's my current implementation of a writ search function, which as far as I know works well. It does have a bit more functionality, but you can strip that out if you don't need it. Line 446 in WritCreator.lua.
Lua Code:
  1. local function writSearch()
  2.     local W = {}
  3.     local anyFound = false
  4.     if not WritCreater.questExceptions then
  5.         return {}, false
  6.     end
  7.     for i=1 , 25 do
  8.         local Qname=GetJournalQuestName(i)
  9.         Qname=WritCreater.questExceptions(Qname)
  10.         if (GetJournalQuestType(i) == QUEST_TYPE_CRAFTING or string.find(Qname, WritCreater.writNames["G"])) and GetJournalQuestRepeatType(i)==QUEST_REPEAT_DAILY then
  11.             for j = 1, #WritCreater.writNames do
  12.                 if string.find(myLower(Qname),myLower(WritCreater.writNames[j])) then
  13.                     W[j] = i
  14.                     anyFound = true
  15.                 end
  16.             end
  17.         end
  18.     end
  19.     return W , anyFound
  20. end
writNames["G"] is "writ", writNames[1 -> 6] are the craft specific names of writs. questExceptions is a pre-format function you can overwrite for specific languages, but not really too important. All of the writNames and questExceptions can be found in the various localization files.

Baertram 06/04/23 12:54 AM

Moved to appropriate forum as this is not a bug, thanks Calamath for the reference.

sinnereso 06/05/23 10:11 AM

Quote:

Originally Posted by Baertram (Post 47872)
Moved to appropriate forum as this is not a bug, thanks Calamath for the reference.

ok I'll go back to GetNumJournalQuests() instead of MAX_JOURNAL_QUESTS since everything is working as intended because I want to run it 5x if 5 quests not 25.

Baertram 06/05/23 11:53 AM

You still did not understand it!
You Must use the max 25 constant as there are gaps in the quest indices and only the "valid" ones (which you need to check via the API functions mentioned by Calamath and others above) of the 1 to 25 are the 5 you got in your list. It's not always 1, 2, 3, 4, 5 as your current situation may have and where it works!

sinnereso 06/05/23 12:20 PM

Quote:

Originally Posted by Baertram (Post 47875)
You still did not understand it!
You Must use the max 25 constant as there are gaps in the quest indices and only the "valid" ones (which you need to check via the API functions mentioned by Calamath and others above) of the 1 to 25 are the 5 you got in your list. It's not always 1, 2, 3, 4, 5 as your current situation may have and where it works!

OK now that sense.


All times are GMT -6. The time now is 06:58 PM.

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