I am trying to release a game pretty soon and I am getting stumped with setting up the steam achievements. I have followed these instructions to the letter:
https://forums.epicgames.com/showthread.php?989161-Help-Needed-with-steam-Achievements-with-UDK
But it didn’t work. It should be mentioned that I am extending my playercontroller from PlayerController rather than UTPlayerController (since extending from UT breaks my game), but I think I have copied all the relevant code into my own player controller.
So far, I have done the following:
Copied:
var Class<UTAchievementsBase> AchievementHandlerClass; // Class used for handling achievements
var transient UTAchievementsBase AchievementHandler; // Object which handles achievement tracking/updates
/**
* Initializes the object responsible for handling/tracking achievements
*/
function InitAchievementHandler()
{
if (AchievementHandler != none)
return;
AchievementHandler = new(self) AchievementHandlerClass;
if (AchievementHandler != none)
AchievementHandler.Initialize();
}
/**
* Unlocks the achievement on the client (can only be done clientside)
*
* @param AchievementId The achievement to update (and possibly unlock)
*/
reliable client function ClientUpdateAchievement(int AchievementId, optional int Count=1)
{
// Spectators don't get any
//if (PlayerReplicationInfo.bOnlySpectator)
// return;
if (AchievementHandler == none)
InitAchievementHandler();
if (AchievementHandler != none)
AchievementHandler.UpdateAchievement(AchievementId, Count);
}
simulated event Destroyed()
{
Super.Destroyed();
if (AchievementHandler != none)
{
AchievementHandler.Cleanup();
AchievementHandler = none;
}
}
DefaultProperties
{
AchievementHandlerClass=Class'UTAchievements'
}
into my player controller class.
I also made sure to update the following in UTAchievements:
Class UTAchievements extends UTAchievementsBase within PlayerController;
instead of
Class UTAchievements extends UTAchievementsBase within UTPlayerController;
When playing the game like that, it seems it finds everything just fine, but when I go through the entire steam process and try to call ClientUpdateAchievement there, nothing happens.