Is it possible to obtain quest title by questID ?
Is it possible to obtain quest title by questID ?
I'm digging through API, but with no result so far. To clarify: Arbitrary questID. I have no idea, if character have the quest, or if it is even available to character. |
I have been wondering the same thing for quite a while and couldn't find anything either :(
Even addons like DataStore save the quest title to their database when accepting/completing quests or from the player's quest log. Same goes for QuestIsDaily and QuestIsWeekly (both only available on quest dialogs) and GetQuestLink (quest log based). Would love to have a GetQuestInfo(questID) function, but so far no luck. |
How about using this on a hidden tooltip object and reading the first line of the tooltip? http://wowprogramming.com/docs/widge...p/SetHyperlink
|
This is a perfect use-case for a metatable and tooltip scanning:
Code:
local MyScanningTooltip = CreateFrame("GameTooltip", "MyScanningTooltip", UIParent, "GameTooltipTemplate") Code:
print(QuestTitleFromID[30318]) You can use the same technique to get the localized name of anything else where there is no relevant API (eg. if you want item or spell names, just use GetItemInfo or GetSpellInfo). For example, there was recently a thread demonstrating this technique for getting localized NPC names from their mobIDs. |
When you set the tooltip to a quest ID it has to request the information from the server if it hasn't been cached yet, it's similar to getting item information.
You can use OnTooltipSetQuest which triggers when the tooltip actually receives new information. Note that the event can fire multiple times for the same quest because the tooltip may contain the name of items in the "Requirements" section and each item name requires another server request. I had written a more complicated example that retrieved the entire quest text but there probably isn't any point in posting it. |
Does that mean that I can do something like
Lua Code:
|
Aww, stupid... After bashing over a wall of air, it finally worked quite nicely.
Lua Code:
Tested on quest id:25323, it properly spit only one line. (Without unsetting OnTooltipSetQuest, it prints a second line, when quest item data is accessed, as semlar pointed out earlier.) |
If you don't need the quest name immediately (eg. you can wait for OnTooltipSetQuest to happen) then that will work, though I'd suggest cleaning it up some. In no particular order:
Code:
local frame = CreateFrame("GameTooltip", "MyPrivateStuff_QuestInfoTooltipFrame", UIParent, "GameTooltipTemplate") |
Quote:
Though, that previous example with metatable will be a little better for when I need to store and handle a list of quest names during a single session. Quote:
Code:
local argv = { strsplit(" ", strtrim(msg)) } Then how do you suggest I prepare it? I have no idea, how many words will be in parameters. Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
Yes, I don't need any more help, than you've provided already. Thank you. Even less I need to be spoon-fed with complete solutions. I'm not brain-damaged, and I still capable of producing my own solutions provided enough strarting information. Which you did. Thank you once more. You even helped me to realize subtle mistakes in my code, which I did not know, and pointed out a major oversight. Great thank you for that. You was of a very big help. Thank you once more. |
And this is why I love WoWInterface's developer community. Never thought of using the almighty SetTooltipHyperlink("quest:"..questID) treatment.
Here's another thank you! |
Quote:
|
Sorry, but your incrimination makes little sense. I posted my code, when it was written. I didn't held it back on purpose, or anything of that kind.
|
Sorry for pulling this thread out of hibernation, but I've encountered a problem with that "frame:SetScript" part(I guess) I'm not able to solve.
Quote:
As far as I (as a newbie) understand the code, the error should refer to the "frame:SetScript" statement, but I'm not sure on that and much less how to solve that. Error Message Code:
Message: Interface\AddOns\McR_Queststat\mcr_queststat.lua:28: ')' expected (to close '(' at line 20) near 'SLASH_MYPRIVATESTUFF1' McRoell |
Code:
frame:SetScript("OnTooltipSetQuest", function(self) |
I strongly suggest an editor capable of structure highlighting, not just keywords.
|
Quote:
I slightly guessed it but had an other issue with that code - usage - which was spoiling my efforts. Thanks to your confirmation I'm all-clear now. McRoell |
Maybe someone knows if it's possible somehow to obtain localized string on different installed languages for quest titles, descriptions, unit titles.
I think it's possible to do with Blizzard API https://develop.battle.net/documenta...game-data-apis But I wonder if it's possible for example GET quest Title, Description for es_ES, and de_DE ingame? I have an idea of making an addon that will help players to learn a foreign language, but I'm not sure what will be the best way to get multiple localization data at the same time. And make addon easy to maintain in case of new content and updates. |
Quote:
I don't think that's possible in-game. You'd only get the info for your current locale |
Installed != Loaded.
WoW will only load one resource pack, so there's nothing different to retrieve. |
Unless I am missing something fundamental I think there is really only one possible way and that is as follows:
First create an addon that generates and account wide saved variable file that you copy and paste into another account wide saved variable file that can be read in by a second addon that uses that file to browse the quest titles, pick a language and display that languages version. The processes involved would amount roughly to the following 1. You ( not the user ) starts wow with language 1 2. Addon1 processes a list of specific quest IDs to get access to the locale specific titles. 3. Addon1 then writes these questID, languageID, questTitle block into the wtf file 4. Repeat 1,2,3 for each language you want to include. 5. Outside of wow edit the wtf created by Addon1 and change the table name to match the one that would be used by Addon2. For each changed version of that wtf file ( when you change information stored, languages added etc ) you will have to instruct the users of Addon2 where they need to place that file, otherwise it will get replaced with an empty file. 6. The user starts wow with their chosen language 7. Addon2 validates if it supports the chosen language and suggests relaying language requirement to the developer ( you ) 8. Assuming the language is supported Addon2 can then access the table to extract language specific versions of the quest title to do what you want it to do.. such as pick the language that this quest text is from ? Pick the French equivalent of this quest title ( shown in the users chosen language) etc. The down side is you are reliant that the user knows where to put the wtf file. Also, that wtf file could grow very big due to the number of quests available and the number of languages available. There will also be a lot of preparation time due to the separate game sessions you will have to use to get access to that data. Technically it is feasible .. but practically it may not be worth the effort unless it is for your own personal use as you could then simply use a single addon to do both and work at your own pace and add languages as you go. Definitely a challenge and could be a good learning curve for you, but for a language buff like me .. not something I would do myself, even for myself. |
Yes, that could be an interesting programming and technical task. I.e. split languages into their own addons to reduce overhead.
However, I see a potential legal issue with such an addon, 'cause it would have to distribute original Blizzard texts. |
Quote:
Oh yes, there is that .. clear forgot that it would be classed as distribution rather than just display. Yep, forget that idea.. |
All times are GMT -6. The time now is 11:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI