Resetting Steam Achievements During Development

I am now onto the phase where I’m implementing Steam Achievements and I need to reset the ones that I’ve earned so that I can test unlocking them again. I found a method


bool ResetAchievements(FUniqueNetId PlayerId)

on the IOnlineAchievements interface, so I tried to implement that method:



bool ASteamHandler::resetAchievements()
{
	IOnlineSubsystem* ion = IOnlineSubsystem::Get(FName("Steam"));

	if (ion == nullptr)
		return false;

	IOnlineAchievementsPtr ach = ion->GetAchievementsInterface();
	ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
	return ach->ResetAchievements(*(ion->GetIdentityInterface()->GetUniquePlayerId(Player->GetControllerId())));
}


However, this always returns false and never starts the clear request. What am I doing wrong? I am logged into Steam when I call this method.

I’d ask in the Steamworks Developer Group. They are usually pretty helpful.

This is better:

FAutoConsoleCommand CmdResetAchievements(
TEXT(“online.ResetAchievements”),
TEXT(“Reset achievements for the currently logged in user.”),
FConsoleCommandDelegate::CreateStatic(ResetAchievements)
);

just paste to the console: “online.ResetAchievements” and press enter ;0

Sorry for my lack of familiarity, but where should I add this code?

I tried adding it to the IOnlineAchivements class in the OnlineAchievementsInterface header but it didn’t work.

Thanks.

Console command online.resetachievements is what you want.

Only works in a developer / debug build, and I’m pretty sure you have to be one of the game devs on Steam too, but not sure about that last part.

Oh! This code is already in the engine, I see… (OnlineSubsystem.cpp)
Thanks!