Discussion:
[hlcoders] Achievements?
Shokunin
2015-05-15 07:13:22 UTC
Permalink
Hey everyone,

These last few nights I've been digging around in the achievement code
trying to figure out if I can activate it for my mod that was recently
greenlit. I'm really hoping I can utilize the existing code and just modify
the achievement id's.

So far I've updated achievement id's in common\hl2orange.spa.h and updated
logic_achievement in the halflife2.fgd. Past that I think all I have to do
is initialize CAchievementMgr. I did that by creating a global pointer and
then pointing it to a new manager.

Where I'm stuck... and I'm not sure if I'm doing this right... is
in CAchievementMgr::PostInit() there's a call to create
a CBaseAchievementHelper object but it doesn't appear to initialize
correctly.

On Line 228 in shared\achievementmgr.cpp:

...
CBaseAchievementHelper *pAchievementHelper =
CBaseAchievementHelper::s_pFirst;
while ( pAchievementHelper )
...

I can't debug into the while loop. After investigating
the CBaseAchievementHelper class I'm just stumped. I honestly can't tell
what it is doing, the code is a bit beyond my understanding.

Has anyone here integrated achievements for a greenlit Source 2007 mod?
Does this seem to be the best path to get achievements implemented? I'm
really just experimenting here so any advice or help would be greatly
appreciated. Many thanks in advance! :)

Loading...