ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Can we have access to buffType? (https://www.esoui.com/forums/showthread.php?t=6851)

Phinix 02/24/17 04:18 AM

Can we have access to buffType?
 
ZOS already has all the Major and Minor buff effect types assigned global variables (Minor Force, Major Brutality, etc.), but the buffType field in all the events was never coded in the API to return these values to us, so it is always blank and inaccessible to addons.

http://wiki.esoui.com/Globals#BuffType

http://wiki.esoui.com/EVENT_EFFECT_CHANGED

It would be very helpful to cut down on the redundant database maintenance for buff trackers like Srendarr to have access to this info from events, and better still, to get a function like GetAbilityBuffType(abilityID) in the future.

@ZOS_ChipHilseberg any chance of this sir? :)

ZOS_ChipHilseberg 02/24/17 03:21 PM

There really isn't anything in the ability data to attach an ability to a specific buff type from the types you mentioned. So the addon lookup tables are the best thing we have right now.

Phinix 02/24/17 03:54 PM

Hey Chip,

Thanks for clarifying. I guess I sort of figured if it was just a matter of adding a pointer to a table you guys would have done it already.

Will be interesting to see how things take shape if the rumors are true and we get some native buff tracking in Morrowind. :)

Solinur 02/24/17 06:20 PM

As written in the chat maybe we should make a lib for this and other "lookup" things related to buffs / procs

Phinix 02/25/17 01:09 AM

Quote:

Originally Posted by decay2 (Post 30044)
As written in the chat maybe we should make a lib for this and other "lookup" things related to buffs / procs

Sure, that would be cool. Here is a simple function I was using to mine all the Major and Minor effect ability ID's for inclusion in the database:

Code:

local function FindByName(text)
        local matchedIDs = {}
        local compareName
        local auraName = text
        for id = 1, 100000 do -- scan all abilityIDs looking for this auraName
                if (DoesAbilityExist(id) and (GetAbilityDuration(id) > 0 or not IsAbilityPassive(id))) then
                        compareName = zo_strformat("<<t:1>>",GetAbilityName(id)) -- strip out any control characters from the ability name
                        if (compareName == auraName) then -- matching ability with a duration (no toggles or passives in prominence)
                                table.insert(matchedIDs, id)
                        end
                end
        end

        if (#matchedIDs > 0) then -- matches were found
                d("-- "..text)
                for _, id in ipairs(matchedIDs) do
                        d("["..id.."] = ,")
                end
        end
end

Example use:

FindByName('Minor Force')

...and here's the current Major/Minor db from Srendarr:

Warning: Spoiler


All times are GMT -6. The time now is 11:48 PM.

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