Hello friends.
It’s me again. Just before uploading my final game build to steam, I wanted to add achievements, however, I am having a very hard time, I tried both methods, by kismet and unreal script, but this is not working.
First of all I followed this tutorial:
www.worldofdasm.com/index_files/STEAMtutorial_menu.htm
It’s very simple and straightforward. The steam achievements setup is basically done by copying the kismet online subsystem classes to the src folder, add these new package on the ini files so it gets compiled. But there is one step which the tutorial did not mention, but I found here on the udn page:
https://docs.unrealengine.com/udk/Three/KismetOnlineSubsystem.html#Downloads
‘’ USE_STEAMWORKS and USE_GAMECENTER are defined in a file called Globals.uci. Comment out the one which you don’t want to use. When you modify Globals.uci, the Unrealscript Compiler won’t automatically pick this up. Thus you’ll need force a recompilation of Unrealscripts when you change it.’’ So I got the kismet nodes on my game.
Then I changed the achievements mapping in DefaultEngineUDK.ini:
[OnlineSubsystemSteamworks.OnlineSubsystemSteamworks]
bEnableSteam=true
bUseVAC=true
GameDir=unrealtest
GameVersion=1.0.0.0
Region=255
CurrentNotificationPosition=8
ResetStats=0
+AchievementMappings=(AchievementId=0,AchievementName=NEW_ACHIEVEMENT_1_0,ViewId=30,ProgressCount=0,MaxProgress=1,bAutoUnlock=True)
+AchievementMappings=(AchievementId=1,AchievementName=NEW_ACHIEVEMENT_1_1,ViewId=30,ProgressCount=0,MaxProgress=1,bAutoUnlock=True)
And last I added the kismet node on a testmap:
Then I tested the game, both offline and online, directly from my game uploaded to steam, because steam client recognizes my game running offline in the same it recognizes my game build uploaded to my steamworks account. The achievements did not unlock.
Here follows my achievements on steamworks panel:
I also created for each achievement a custom stats, following the tutorial on UDN Online Subsystem Works:
However, as I said, the achievements of my game don’t get unlocked by the kismet node:
Then I tried to unlock achievements directly from Unreal Scripting, following these 2 tutorials here:
https://forums.unrealengine.com/t/urgent-i-really-need-help-setting-up-steam-achievements/76959
Here follows the changes I made on UTAchievements:
enum EUTGameAchievements
{
EUTA_EXPLORE_EveryMutator,
EUTA_WEAPON_DontTaseMeBro,
EUTA_WEAPON_StrongestLink,
EUTA_WEAPON_HaveANiceDay,
EUTA_VEHICLE_Armadillo,
EUTA_POWERUP_DeliveringTheHurt,
EUTA_HUMILIATION_SerialKiller,
EUTA_HUMILIATION_OffToAGoodStart,
NEW_ACHIEVEMENT_1_0,
NEW_ACHIEVEMENT_1_1,
};
I added my 2 custom achievements here, then on the default properties I commented the UTAchievements and let only mine:
defaultproperties
{
AchievementStatsReadClass=Class'UTStatsReadAchievements'
AchievementStatsWriteClass=Class'UTStatsWriteAchievements'
// @todo: Figure out if you want to add automatic progress for bitmask toasts (or if you want to, e.g., update two different stats for it,
// one bitmask, one count)
// The list of achievements
//AchievementsArray.Add((Id=EUTA_EXPLORE_EveryMutator,UnlockType=EAUT_BitMask,UnlockCriteria=0x1ff,ProgressCriteria=3,bDoUnlock=True,bDoProgress=True))
// The below achievements are setup so the achievement manager does not handle unlocks/progress-toasts for these achievements;
// instead, this is handled by OnlineSubsystemSteamworks automatic achievement progress/unlock handling.
// To regain control of unlocks/progress from here, bAutoUnlock (and ProgressCount, if you want control of progress toasts) must be
// unset in AchievementMappings in DefaultEngineUDK.ini, and bDoUnlock/bDoProgress must be set to True here
//AchievementsArray.Add((Id=EUTA_WEAPON_DontTaseMeBro,UnlockType=EAUT_Count,UnlockCriteria=4,ProgressCriteria=2,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_WEAPON_StrongestLink,UnlockType=EAUT_Count,UnlockCriteria=4,ProgressCriteria=2,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_WEAPON_HaveANiceDay,UnlockType=EAUT_Count,UnlockCriteria=4,ProgressCriteria=2,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_VEHICLE_Armadillo,UnlockType=EAUT_Count,UnlockCriteria=4,ProgressCriteria=2,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_POWERUP_DeliveringTheHurt,UnlockType=EAUT_Count,UnlockCriteria=60,ProgressCriteria=30,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_HUMILIATION_SerialKiller,UnlockType=EAUT_Count,UnlockCriteria=1,ProgressCriteria=0,bDoUnlock=False,bDoProgress=False))
//AchievementsArray.Add((Id=EUTA_HUMILIATION_OffToAGoodStart,UnlockType=EAUT_Count,UnlockCriteria=1,ProgressCriteria=0,bDoUnlock=False,bDoProgress=False))
AchievementsArray.Add((Id=NEW_ACHIEVEMENT_1_0,UnlockType=EAUT_Count,UnlockCriteria=1,ProgressCriteria=0,bDoUnlock=True,bDoProgress=True))
AchievementsArray.Add((Id=NEW_ACHIEVEMENT_1_1,UnlockType=EAUT_Count,UnlockCriteria=1,ProgressCriteria=0,bDoUnlock=True,bDoProgress=True))
}
Then I changed UTStatsReadAchievements:
defaultproperties
{
ViewId=`STATS_GROUP_ACHIEVEMENTS
ViewName="Achievements"
// Column names for the table view
//ColumnIds.Add(EUTA_EXPLORE_EveryMutator)
//ColumnIds.Add(EUTA_WEAPON_DontTaseMeBro)
//ColumnIds.Add(EUTA_WEAPON_StrongestLink)
//ColumnIds.Add(EUTA_WEAPON_HaveANiceDay)
//ColumnIds.Add(EUTA_VEHICLE_Armadillo)
//ColumnIds.Add(EUTA_POWERUP_DeliveringTheHurt)
//ColumnIds.Add(EUTA_HUMILIATION_SerialKiller)
//ColumnIds.Add(EUTA_HUMILIATION_OffToAGoodStart)
ColumnIds.Add(NEW_ACHIEVEMENT_1_0)
ColumnIds.Add(NEW_ACHIEVEMENT_1_1)
// Column metadata
//ColumnMappings.Add((Id=EUTA_EXPLORE_EveryMutator,Name="EUTA_EXPLORE_EveryMutator"))
//ColumnMappings.Add((Id=EUTA_WEAPON_DontTaseMeBro,Name="EUTA_WEAPON_DontTaseMeBro"))
//ColumnMappings.Add((Id=EUTA_WEAPON_StrongestLink,Name="EUTA_WEAPON_StrongestLink"))
//ColumnMappings.Add((Id=EUTA_WEAPON_HaveANiceDay,Name="EUTA_WEAPON_HaveANiceDay"))
//ColumnMappings.Add((Id=EUTA_VEHICLE_Armadillo,Name="EUTA_VEHICLE_Armadillo"))
//ColumnMappings.Add((Id=EUTA_POWERUP_DeliveringTheHurt,Name="EUTA_POWERUP_DeliveringTheHurt"))
//ColumnMappings.Add((Id=EUTA_HUMILIATION_SerialKiller,Name="EUTA_HUMILIATION_SerialKiller"))
//ColumnMappings.Add((Id=EUTA_HUMILIATION_OffToAGoodStart,Name="EUTA_HUMILIATION_OffToAGoodStart"))
ColumnMappings.Add((Id=NEW_ACHIEVEMENT_1_0,Name="NEW_ACHIEVEMENT_1_0"))
ColumnMappings.Add((Id=NEW_ACHIEVEMENT_1_1,Name="NEW_ACHIEVEMENT_1_1"))
}
Then I also changed UTStatsWriteAchievements :
defaultproperties
{
ViewIds=(`STATS_GROUP_ACHIEVEMENTS)
// Properties and their types
//Properties.Add((PropertyId=EUTA_EXPLORE_EveryMutator,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_WEAPON_DontTaseMeBro,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_WEAPON_StrongestLink,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_WEAPON_HaveANiceDay,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_VEHICLE_Armadillo,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_POWERUP_DeliveringTheHurt,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_HUMILIATION_SerialKiller,Data=(Type=SDT_Int32,Value1=0)))
//Properties.Add((PropertyId=EUTA_HUMILIATION_OffToAGoodStart,Data=(Type=SDT_Int32,Value1=0)))
Properties.Add((PropertyId=NEW_ACHIEVEMENT_1_0,Data=(Type=SDT_Int32,Value1=0)))
Properties.Add((PropertyId=NEW_ACHIEVEMENT_1_1,Data=(Type=SDT_Int32,Value1=0)))
}
Last but not least, I changed my custom player controller following the last tutorial, I just added this piece of code on the beginning of my player controller class:
/**
* 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 PostBeginPlay()
{
Super.PostBeginPlay();
}
simulated event Destroyed()
{
Super.Destroyed();
if (AchievementHandler != none)
{
AchievementHandler.Cleanup();
AchievementHandler = none;
}
}
And on the end I added these 2 custom exec functions to test the achievement unlock:
exec function UnlockAchievement0()
{
ClientUpdateAchievement(NEW_ACHIEVEMENT_1_0, 1);
}
exec function UnlockAchievement1()
{
ClientUpdateAchievement(NEW_ACHIEVEMENT_1_1, 1);
}
DefaultProperties
{
AchievementHandlerClass=Class'UTAchievements'
}
It is still not working, however, whenever I run these functions to unlock the achievement, I receive the error message UTAchievements Failed to read online achievement stats.
Please guys, before giving up achievements for my game, I need some help from more experienced udk users.
Thanks in advance.