That's using offical API functions:
Lua Code:
local function GetAll()
local function GetAchievements(topLevelIndex, categoryIndex, numAchievements)
for achievementIndex=1,numAchievements do
local achievementId = GetAchievementId(topLevelIndex, categoryIndex, achievementIndex)
local _, _, _, _, completed = GetAchievementInfo(achievementId)
while achievementId ~= 0 do
d(achievementId)
achievementId = GetNextAchievementInLine(achievementId)
end
end
end
local numCategories = GetNumAchievementCategories()
for topLevelIndex=1,numCategories do
local _, numSubCatgories, numAchievements = GetAchievementCategoryInfo(topLevelIndex)
GetAchievements(topLevelIndex, nil, numAchievements) -- General
for subCategoryIndex=1,numSubCatgories do
local _, numAchievements = GetAchievementSubCategoryInfo(topLevelIndex, subCategoryIndex)
GetAchievements(topLevelIndex, subCategoryIndex, numAchievements)
end
end
end
But you can probe the ids with local name = GetAchievementInfo(id) until name is nil.
Originally Posted by hisdad
Thx Votan,
It works with the problem that no matter how many I want (9999) it returns a max of 10.
Is there a better way of doing this?
--Dad
|