Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get/Set Stat/Achievement always return True without doing anything? #63

Open
niemasd opened this issue Feb 17, 2021 · 5 comments
Open

Comments

@niemasd
Copy link

niemasd commented Feb 17, 2021

I built a game in Python that I'm trying to publish on Steam, and I have things working fine with regard to just running as well as using Steam cloud saves, but I'm trying to use SteamworksPy to get Achievements working. However, I'm running into the following issue:

  • Any time I use GetStatInt to get any stat (even ones that don't exist), it always returns 0
  • Any time I use SetStat, it returns True, but when I subsequently use GetStatInt, the value is unchanged (still 0)
  • Any time I use GetAchievement to get any achievement (even ones that don't exist), it always returns True
  • Any time I use SetAchievement, it always returns True

Here's a minimum working example of the relevant SteamworksPy code:

if version_info >= (3, 8):
    add_dll_directory(getcwd())
from steamworks import STEAMWORKS
steamworks = STEAMWORKS()
steamworks.initialize()
steamworks.RequestCurrentStats()
print(steamworks.Users.GetSteamID())
print("GetStatInt: " + str(steamworks.UserStats.GetStatInt("FINISHED_CHAP_01")))
print("SetStat:    " + str(steamworks.UserStats.SetStat("FINISHED_CHAP_01",1)))
print("StoreStats: " + str(steamworks.UserStats.StoreStats()))
print("GetStatInt: " + str(steamworks.UserStats.GetStatInt("FINISHED_CHAP_01")))
exit()

This prints the following (I've replaced the AppID and SteamID with <my correct AppID> and <my correct SteamID> for privacy):

Setting breakpad minidump AppID = <my correct AppID>
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  <my correct SteamID> [API loaded no]
<my correct SteamID>
GetStatInt: 0
SetStat:    True
StoreStats: True
GetStatInt: 0

I'm using Python 3.8.7 and the Steamworks SDK 1.5.1. I'm also using the precompiled 32-bit SteamworksPy.dll ("Master Pre-Compiles - Version 1.6.2"). Help would be greatly appreciated 😄

@philippj
Copy link
Owner

Hey,

the precompiles currently available under "Releases" are quite out of date. So I can not tell whether they are still functional at all. Please try if the issue persists with the newer release from https://github.com/philippj/SteamworksPy/tree/master/redist/windows.

@niemasd
Copy link
Author

niemasd commented Feb 17, 2021

Ah, thanks for the quick response! I ideally want it to be 32-bit, so I'll try recompiling from scratch. I'll add a comment with the results

@niemasd
Copy link
Author

niemasd commented Feb 17, 2021

I just tried compiling from SteamworksPy.dll from scratch from the command line using the Visual Studio tools (using Steamworks SDK 1.5.1), and I encounter the same behavior

@sudasana
Copy link
Contributor

I think you need to call

steamworks.run_callbacks()

after RequestCurrentStats() and before GetStatInt - this works for me

@rejedai
Copy link

rejedai commented May 10, 2022

try (b'FINISHED_CHAP_01')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants