Steam Leaderboard Not Working

Hello, I have an issue for Steam Leaderboard system. I can’t write leaderboard integer neither with Blueprints nor with C++. I’m looking forums-answers for this issue and my mind will blow. Someone says “You need to put ‘_’ between names” but it doesn’t work for me.
Here’s my code for write integer value;

FOnlineLeaderboardWrite write;
write.DisplayFormat = ELeaderboardFormat::Number;
write.SortMethod = ELeaderboardSort::Descending;
write.UpdateMethod = ELeaderboardUpdateMethod::KeepBest;
TArray<FName> LeaderboardName;
LeaderboardName.Add(TEXT("PHScore"));
write.LeaderboardNames = LeaderboardName;
write.RatedStat = TEXT("PHBestScore");
write.SetIntStat(TEXT("PHBestScore"), 10);
iol->WriteLeaderboards("GameSession", *pid, write);

And I get this error message;

[2021.04.05-12.01.12:105][677]LogOnlineLeaderboard: Warning: STEAM: Failure to write key value pair when uploading to Steam PHScore_PHBestScore=10
[2021.04.05-12.01.12:106][677]LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamUpdateStats bWasSuccessful: 0 User: Anoberia [0x21132F2FFD0]' failed in 0.756331 seconds
[2021.04.05-12.01.12:109][678]LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamUpdateLeaderboard bWasSuccessful: 0 Leaderboard: PHScore Score: 0' failed in 0.758298 seconds

I run game via .bat. I can see Steam Overlay so it connected steam subsystem. But how can I write integer properly? There’s a reading part which I don’t want to think of. :slight_smile: Anyone help me?

Also, if I run this code, it creates a section named I mentioned in c++ but it doesn’t upload any entry.

Did you manage to resolve this? I’m having the same issue.

Same issue with a 5.1 project.
The achievements are working but the leaderboards functions always return a failure

Failure to read key value pair during retrieval from Steam Score_Score
Failure to write key value pair when uploading to Steam Score_Score=10

Any Idea why ?

Hey D.Kermel, and in case anyone else needs help with this.

It’s not enough to just create Leaderboard in the Steam. You need to create stat.

So if you created Leaderboard names Leaderboard1, you need to go to stats, and create stat Leaderboard1_Leaderboard1. Set by is set to Client.

Then it started working for me.

1 Like