Quantcast Caching talent info - WoWInterface
 
Thread Tools Display Modes
08-24-14, 03:06 PM   #1
InKahootz
A Murloc Raider
Join Date: Aug 2014
Posts: 7
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?
 
08-24-14, 04:56 PM   #2
Cybeloras
A Fallenroot Satyr
 
Cybeloras's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 28
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. =/

Last edited by Cybeloras : 08-24-14 at 05:02 PM.
 
08-26-14, 02:35 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,327
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.
__________________
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » Caching talent info

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off