Closed mojoyup1528 closed 5 months ago
Don’t see any issues with the code. You should be able to call Steam from anywhere globally.
Some ideas:
Is there any error being printed in the console?
If you step through set_leaderboard in the debugger, is there anything different happening compared to your first script that’s working?
How are you confirming the leaderboard is updated? Through the steamworks page or the api?
Ill probably get ahold of them then because there are zero errors in Godot. It seemed like a timing issue even though I was testing with yields as well but weird thing is, sometimes it worked and sometimes it didnt after that so if the code looks fine, Im pretty sure its a Steam issue. Thank you for responding!
One thing is that Steam rate limits leaderboard updates. Could of been that.
So I contacted them, and they told me that I have to force an update on the leaderboards if I don't have 'trusted' resources for updating as the leaderboards set everything to default regardless of the API calls when a game is published.
SO, I found in your API, the Steam.LeaderboardUploadScoreMethod.ForceUpdate. I just use that as the last argument in the API call and that seems to work..so far lol! :) :) I know I closed this BUT I figured an 'answer' might help others so hope that is ok!
I just need to find a way to encrypt it in the gdscript so no one can backtrack the calls somehow since values are shown in the code, unless you dont think that would be an issue :P
For some reason,, I can update a leaderboard from one scene, but not another. I have this that sets my leaderboards right now:
and if you notice the commented out parts, those are just from the API for set_leaderboard_score. THOSE actually work but I dont need to do it there. When I play the game, I have another script after loading everything that tries to update the Most_Games_Played leaderboard score. BUT it wont do it there, though it works by uncommenting it out here (which is a scene no longer in the tree when playing so I cant do it from here, this is ONLY for the menu leaderboard).
SO, in the other script, I have this:
where in my SaveLoad script as an autoload, it calls this:
BUT even if I dont use the SaveLoad pass, or even if I directly set it using just a number typed in the script, it will not update the leaderboard score. I can even do exactly this in the game ready function: _Steam.set_leaderboard_score('Most_GamesPlayed', 12) and it wont do it, but it will update it in the first script. It SHOULD be a global thing as Steam is global as an API, and its already a game on Steam so its set up correctly I promise that.
Any thoughts?