WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoD Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=151)
-   -   Caching talent info (https://www.wowinterface.com/forums/showthread.php?t=49791)

InKahootz 08-24-14 03:06 PM

Caching talent info
 
So you used to be able to cache talent info (without inspecting) so you could quickly access it later via

Code:

local tname, tex, tier, column, sel, avail = GetTalentInfo (idx, true, nil, nil, class_id)
Where idx was from 1 to 21 and class_id was from 1 to GetNumClasses()

However in WoD the GetTalentInfo is now
Code:

talentID, name, iconTexture, selected, available = GetTalentInfo(tier, column, talentGroup [, isInspect, inspectedUnit])
And of course you still have to scan a tooltip to convert that talentID into a spellID (unless there is an easier way).
So my question, did blizz remove the ability to get other class talent info without inspecting or do I just need to build the cache as players are inspected?

Cybeloras 08-24-14 04:56 PM

GetTalentInfoByID() is extremely fast, so you could just do this:

Lua Code:
  1. for i = 1, 30000 do
  2.    local id, name, iconTexture, selected, available = GetTalentInfoByID(i)
  3.    if id then
  4.       ...
  5.    end
  6. end

The only issue is that it doesn't tell you what class a talent belongs to.

If you want to tighten up the ID range, the first talent is 15757, and it is highly improbable that it would ever decrease. The last is 21811. But, like I said, the function is super fast so it really doesn't matter much as long as you only ever iterate through once.

Blizzard should have made GetTalentInfo() take specID as a parameter instead of talentGroup -- all their code would still be possible, and yours would be too. =/

Xrystal 08-26-14 02:35 PM

Well thought I found a solution but I suspect it is bugged based on my results.

Functions I have been using:
Lua Code:
  1. local numClasses = GetNumClasses()
  2. local classDisplayName, classTag, classID = GetClassInfo(classIndex)  -- classIndex ( 1 to numClasses )
  3. local numSpecs = GetNumSpecializationsForClassID(classID)
  4. local specID, specName, description, specIcon, background, role = GetSpecializationInfoForClassID(classIndex, specIndex) -- classIndex ( 1 to numClasses ) specIndex ( 1 to numSpecs )
  5. local spells = { GetSpecializationSpells(specID) } -- returns a list of spellID,levelLearned values
  6. local spellName = GetSpellInfo(spellID)
  7. local spellLink = GetSpellLink(spellID)
  8.  
  9. -- This I suspect is the correct one to use to look at the Player/Inspected talents
  10. --local talentID, talentName, talentIcon, selected, available = GetTalentInfo(tier, column, specIndex)
  11.  
  12. -- This I suspect is the correct one to use to look at any Spec but for some reason it looks at the specIndex rather than the specID.  I tried both and only the former works and grabs the talents for the active player's talents and I suspect the inspected player's talents as requested
  13. local talentID,talentName,talentIcon,selected,available = GetTalentInfoBySpecialization(specIndex,tier,column)
  14.  
  15. In these two functions tier is 1 to MAX_TALENT_TIERS and column is 1 to NUM_TALENT_COLUMNS as currently defined in the Blizzard Talent Frame source code.
  16.  
  17. The reason I suspect these are faulty is because I cannot believe that they have 2 differently named functions with the same parameters ( albeit in a different order ) that return the same values.
  18.  
  19. local talentLink = GetTalentLink(talentID)
All of these functions work as expected apart from the GetTalentInfoBySpecialization which I suspect isn't working right.

EG.

This is an example output if I used specID in that function for each tier/column
Lua Code:
  1. classTag = DRUID - specIndex = 1 - specID = 102 - specName = Balance - talentID = nil - talentName = nil
  2. classTag = DRUID - specIndex = 2 - specID = 103 - specName = Feral - talentID = nil - talentName = nil
  3. classTag = DRUID - specIndex = 3 - specID = 104 - specName = Guardian - talentID = nil - talentName = nil
  4. classTag = DRUID - specIndex = 4 - specID = 105 - specName = Restoration - talentID = nil - talentName = nil
This is an example output for the last talent in each of the specIndex's for the players class regardless of which class/spec is being requested.

Lua Code:
  1. classTag = DRUID - specIndex = 1 - specID = 102 - specName = Balance - talentID = 21673 - talentName = Saved By The Light  (Holy Spec for my active Paladin Class - which is my 2nd talent spec)
  2. classTag = DRUID - specIndex = 2 - specID = 103 - specName = Feral - talentID = 21203 - talentName = Holy Shield ( Protection Spec for my active Paladin Class - 1st talent spec )
  3. classTag = DRUID - specIndex = 3 - specID = 104 - specName = Guardian - talentID = 21672 - talentName = Final Verdict ( suspect Retribution Spec for Paladin class - not chosen as a talent )
  4. classTag = DRUID - specIndex = 4 - specID = 105 - specName = Restoration - talentID = nil - talentName = nil  - Paladin's don't have 4 talent choices.

These 3 paladin spec talents are displayed for each class's spec selections. A quick jump onto a few other classes and the appropriate loaded characters talents are displayed instead of the requested specIndex's talent section.


All times are GMT -6. The time now is 09:45 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI