Steam Leaderboards - can't get it to write score value

Okay, I’ve been bashing my head against my desk over this for the past few hours now.

I’ve successfully gotten WriteLeaderboards() to work…ish

Using this code:

It creates a leaderboard under my steamworks account titled ClassicMode! Hooray! I can rest assured that my game is linked to my steam app id properly.

HOWEVER, I can’t actually get it to add an entry. Using the SetIntStat (circled in red) I’ve tried “Score” “score” and a TON of other possibilities (so many attempts), but I can’t get it to write a value to the leaderboard. I’ve also tried int and int32 data types.

For reference, here’s the empty leaderboard created in my steamworks account:

Any idea what I should write in SetIntStat to get it to actually write an entry to the leaderboard? OR if SetIntStat is incorrect, what should I be using?

The answer was to make a steam stat in addition to the leaderboard named “StatName_Statname” where StatName is the name called by SetIntStat.

However, now it’s incrementing the scores instead of replacing them which is frustrating…

I’m having the same problem. I’m able to read my score, but I can’t get the score to display. I got it working once, but after trying to change it around I broke it. So frustrating!

Unfortunately, you’re not going to be able to do steam leaderboards in any decent capacity using blueprint OR UE4’s OnlineSubsystem - you have to go around it using native steam methods in C++

The reason is - using UE4’s OnlineSubsystem, there is no way to read an arbitrary range of scores (like the top 10) - you can only give it specific player IDs and see those scores. Also, UE4’s OnlineSubsystem is just riddled with issues for Leaderboards…

I found this article helped a lot for accessing native steamworks functions:

From here, I wrote some blueprint-callable methods using the “Leaderboards: How-To” article under the steam partner site. (It’s pretty much copy-paste)

Hi Oraclefish,
for days I am trying to replicate what you have posted.
Could you be so kind and post the c++ class you have created in the editor with the “leaderboard how to” code added?

the “leaderboard-how to” code for the header gives me error messages at “ccall” and I have no clue what is happening.

thanks in advance

Holy *** you just answered something I could NOT find after skimming every pages I could find. Not even Epic’s docs are mentioning this anywhere (or if it does it’s ■■■■ well hidden)… The StatName_StatName was what’s missing… thanks a lot !

very nice answer,I find the StatName_StatName for many days

I am in 4.18.3 and its not working for me. Any idea why? Did you change anything in cpp files ?