ALL THE THINGS

ALL THE THINGS

31M Downloads

Can the ATT data be used in game for other addons?

TheKrowi opened this issue ยท 3 comments

commented

Hey, this is a question directed to the devs and owners of ATT. I have a small achievement addon that can be found here: https://github.com/TheKrowi/Krowi_AchievementFilter. I've been noticing I'm adding a lot of duplicate data on my end and was wondering if it's possible to ask ATT ingame for data related to an achievement and show this data where I need it or use it for additional filters users might want. Before I do any development I first want to ask permission if I can use the data and if it's possible or if everything is locked behind local variables or not.

commented

We don't have any great documentation on exposure of our data in game, but we do link it all into a global AllTheThings which has a lot of content available to reference by other add-ons or scripts. Crieve seems to be pretty open about others being able to utilize the data, hence why it's all connected to a global.
Typically the data access would be done via AllTheThings.Search* methods rather than direct access to the raw data objects, which isn't really feasible.
If you could explain a bit of what you would prefer to accomplish maybe one of us can help direct your dev efforts in using ATT data in game.

commented

My goal is to enhance my addon with data from ATT if users have it. Right now I'm manually inputting if an achievement is pvp related or not. I noticed ATT also has this data so it's redundant imo to both have this data in our addons. What would be easy for me is ask ATT something like AllTheThings.GetAchievementInfo(achievementId) and get a fixed table of data back. Below is something I could think of atm.

local achInfo = AllTheThings.GetAchievementInfo(achievementId)

achInfo = {
    Id = 19443,
    IsPvp = true,
    AddedInPatch = 10.2.0,
    RemovedInPatch = 10.2.6,
    MapIds = { }, -- List of maps Ids this achievement relates to 
    RewardType = nil, -- Could be Mount, Pet, ...
    CategoryTrees = { } -- List of the categories (see image)
}

image

Maybe something to mention to, if I use ATT data I would add a reference to ATT so it's clear where the data comes from for the user.

commented

So your best bet on that is using the SearchForObject function. Provide the 'field' you want to search (i.e. 'achievementID') and the 'value' of that field (e.g. 222 [Tower Defense)
Thus the command: /run ATTC.PrintTable(ATTC.SearchForObject("achievementID", 222))
(Globals ATTC == AllTheThings, for now)
Gives:
image

There's a bit of extra stuff from PrintTable but it prevents the default /dump insanity of following hierarchical tables.
But you can see the pvp: 1 would tell you that this 'Thing' you searched for is related to PvP.