Questie

Questie

116M Downloads

API

ShervinNejad opened this issue ยท 2 comments

commented

Thanks for a great addon!
Is there any way to grab data from your database so I can use it in my own addon?
I need to get the quest level from questID.

In the beta, I could use:

local questID = 12345
local questLevel = QuestieDB.questData[questID][5]

but it doesn't work anymore, since you made the database local.

Thanks!

commented

Hello there.

We introduced a module loading system a while back so as to not pollute the global namespace with our stuff, and there is also a wrapper function to access the DB. This should work when Questie is enabled:

local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
local quest = QuestieDB.GetQuest(12345)
local questLevel = quest.level

See here if you want to know how the quest object is structured.

Notice that the comment says the field is called questLevel, but it's called level if you read the actual code. Not sure how far those comment/code inconsistencies go.

I'll close this issue, since it's not something we need to fix, but feel free to comment here if you have more questions about this.

commented

Thanks a lot for the help!
It works fine now :)