1
Weird... They should name the method so but for me it doesn't make sense to return only completed achievements.
Well what i wanted to do: if the event EVENT_ACHIEVEMENT_UPDATED is thrown i get all events with the same progress criterion that got updated. In the most cases the achievements are on the same line, so i just wanted to show only the next achievable achievement.
I tried to check if there is a previous achievement and the previous achievement in the line is also incomplete, i wanted to ignore the event. So that my handler starts handling only when
1. there is no previous achievement and the one updated (this one) is incomplete
2. there is a previous achievement but that one is complete and this updated one is incomplete
At the moment i cannot differentiate between those cases. I could check if GetPreviousAchievementInLine returns 0. Works great for achievement lines. If it returns 0, i can ignore it because the previous one ins incomplete. The previous one may return a achievementId beceause the first achievement in the line is complete, so its perfect.
But i run into problems when i try to use this on the first achievement in the line or on achievements without a line. They also return 0 and i can't ignore them because they they just have no previous achievements
i hope you can understand my problem :/
2
I am listening to the event
Lua Code:
-- Register Events
AchievementInfo.registerEvent(EVENT_ACHIEVEMENT_UPDATED, AchievementInfo.onAchievementUpdated)
And let's say my handler looks like
Lua Code:
function AchievementInfo.onAchievementUpdated(eventCode, achId)
d(achId) -- for example 41, 67, ...
d("- GetCatInfo")
d(GetCategoryInfoFromAchievementId(achId))
local a, b, c = GetCategoryInfoFromAchievementId(achId)
d("- getAId")
d(GetAchievementId(a, b, c)) -- for example 41, but not 67, ... !?
end
i get the following results when harvesting wood for example, where 67 and 68 are the last two harvester achievements (
http://esohead.com/achievements/67-node-harvester-iv and
http://esohead.com/achievements/68-node-harvester-v ) that get updated when harvesting sth... Achievement ID 41 in the screens below is the achievement for slaying plants... that works correct
The main problem is: i want to get the category name of the achievements. Works fine with achId 38 or 41 when slaying humanoids or plants
Lua Code:
local categoryTopLevelIndex = GetCategoryInfoFromAchievementId(achId)
local catName = GetAchievementCategoryInfo(categoryTopLevelIndex)
but not for the node harvester achievements for example. because it returns the 2, nil, 2 thing. 2 is not the crafting category...
PS: I get the same 2, nil, 2 results for achId 65 and 66, hmm