Access Player Statistics
I am trying to access the players statistics data as shown in the achievement frame statistics tab.
I assume there is a table of statistics yet I have not been able to find it. I have looked in the StatsFrame.xml and StatsFrame.lua files but can see nothing that defines the statistics table. How do I find the appropriate statistics table? |
Are you meaning, how to get achievement information?
and GetAchievementCriteriaInfo In Blizzard_AchievementUI.lua probably start at: Code:
function AchievementStatTemplateMixin:Init(elementData) |
Heya Fizzlemizz
I don't need the achievements, I want the player stats, such as how many deaths, items consumed, flight paths taken, etc. These stats are displayed in the Statistic Tab in the achievement UI. |
Might want to check out GetStatistic(). GetStatisticsCategoryList() appears to return a list of statistic CategoryIDs that can be enumerated through with the generic achievement functions to find the AchievementID you want.
For example: Lua Code:
This prints the entire list of statistics, their related AchievementID for later tracking, and the current statistic value. It takes a few seconds to complete. |
The AchievementStatTemplateMixin:Init function is called to fill each row of the stats list.
The GetAchievementInfo function returns information including the stat name, then either GetStatistic or GetAchievementCriteriaInfo depending. |
Hi Fizzlemizz and SDPhantom
Thanks for your help, your answers make sense and the code provided absolutely works. Cheers |
All times are GMT -6. The time now is 02:55 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI