Hey all,
I'm working on an auto-updated for eso-database and it's working great so far, however I run into one problem. I'm exporting all the achievements, so iconpath, name, description etc. All the achievements get exported except the ones that have sub-achievements.
With achievements like the one below, only the first one gets exported.
Here is the piece of code:
Lua Code:
local function ExportAchievements()
-- Reset achievements
table.remove(ESODB.SV["Achievements"])
ESODB.SV["Achievements"] = {}
for categoryIndex = 1, GetNumAchievementCategories() do
local _, numSubCategories, numAchievements = GetAchievementCategoryInfo(categoryIndex)
for i = 1, numAchievements do
local achievementId = GetAchievementId(categoryIndex, nil, i)
local name, description, points, icon, completed, date, time = GetAchievementInfo(achievementId)
table.insert(ESODB.SV.Achievements, {
achievementId = achievementId,
name = name,
description = description,
points = points,
icon = icon,
date = date,
time = time
})
end
for subCategoryIndex = 1, numSubCategories do
local _, subNumAchievements = GetAchievementSubCategoryInfo(categoryIndex, subCategoryIndex)
for i = 1, subNumAchievements do
local achievementId = GetAchievementId(categoryIndex, subCategoryIndex, i)
local name, description, points, icon, completed, date, time = GetAchievementInfo(achievementId)
table.insert(ESODB.SV.Achievements, {
achievementId = achievementId,
name = name,
description = description,
points = points,
icon = icon,
date = date,
time = time
})
end
end
end
end
Any idea for a workaround?