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

**URL:** <https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287>\
**Category:** Platform & Builds\
**Tags:** onlinesubsystem, steamworks, leaderboard, UE4-13, unreal-engine, CPP, question\
**Created:** [October 3, 2016, 4:59am UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287 "2016-10-03T04:59:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oraclefish](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oraclefish](https://forums.unrealengine.com/u/Oraclefish)\
**Post date:** [October 3, 2016, 4:59am UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/1 "2016-10-03T04:59:46Z")

</div>

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:

 ![109441-01_statwrite.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/5/26558dad1b55877c4ac0cd3de1f1b56c8df0fdde.png)

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:

 ![109442-02_classicmode.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/9/2e926c0c87968907b3f48d2eb9bf7cfdd7e10e8a.png)

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?

---

<div class="post-metadata">

**Author:** ![Oraclefish](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oraclefish](https://forums.unrealengine.com/u/Oraclefish)\
**Post date:** [October 4, 2016, 1:41am UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/2 "2016-10-04T01:41:01Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![borbs727](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@borbs727](https://forums.unrealengine.com/u/borbs727)\
**Post date:** [January 20, 2017, 10:30pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/3 "2017-01-20T22:30:52Z")

</div>

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!

 ![122966-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/4/4e4d6d1c2b37e78ce454b64d7ad772a12fb36e08.jpeg)

---

<div class="post-metadata">

**Author:** ![Oraclefish](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oraclefish](https://forums.unrealengine.com/u/Oraclefish)\
**Post date:** [January 21, 2017, 6:53pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/4 "2017-01-21T18:53:37Z")

</div>

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:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

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)

---

<div class="post-metadata">

**Author:** ![MeMe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MeMe](https://forums.unrealengine.com/u/MeMe)\
**Post date:** [February 1, 2017, 3:37pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/5 "2017-02-01T15:37:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Genova](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Genova](https://forums.unrealengine.com/u/Genova)\
**Post date:** [November 20, 2017, 1:47pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/6 "2017-11-20T13:47:26Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_774b3ee2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_774b3ee2](https://forums.unrealengine.com/u/anonymous_user_774b3ee2)\
**Post date:** [March 1, 2018, 7:12am UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/7 "2018-03-01T07:12:01Z")

</div>

very nice answer,I find the **StatName\_StatName** for many days

---

<div class="post-metadata">

**Author:** ![sanjithkanagavel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sanjithkanagavel](https://forums.unrealengine.com/u/sanjithkanagavel)\
**Post date:** [March 21, 2018, 8:54pm UTC](https://forums.unrealengine.com/t/steam-leaderboards-cant-get-it-to-write-score-value/372287/8 "2018-03-21T20:54:12Z")

</div>

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