philippj / SteamworksPy

A working Python API system for Valve's Steamworks.
MIT License
212 stars 39 forks source link

Cant Update Stats or Achievments #102

Open BiggTurkk opened 2 months ago

BiggTurkk commented 2 months ago

Ive tried just about everything and no matter what I do I get:

Setting breakpad minidump AppID = SteamInternal_SetMinidumpSteamID: Caching Steam ID: [API loaded no]

I do not recieve any errors, if i try to fetch stats I always get 0 and I always get False when I fetch achievments. I am able to print my level and id.

What am I missing?

64bit I am working with SDK 1.55 64bit (does this work with a newer version)

Baddieus commented 1 month ago

Not sure if this is the answer you are looking for, but I was having a tough time getting any achievement to unlock and display for me in my game testing until I found the below answer and added a 'b' to my code:

self.steamworks.UserStats.SetAchievement('EASY_CASUAL') self.steamworks.UserStats.SetAchievement(b'EASY_CASUAL')

The b before 'EASY_CASUAL' in b'EASY_CASUAL' is used to indicate that the string is a byte string.

In Python, strings are sequences of characters and they are stored as Unicode. However, when you’re dealing with data from files, networks, or APIs, you often need to work with bytes. This is where byte strings come in.

A byte string is a string of bytes, not characters. It doesn’t have an encoding (like UTF-8, ASCII, etc.). When you put a b before a string in Python, you’re telling Python to treat the string as a byte string.

In this case, b'EASY_CASUAL' is a byte string. This is apparently required by the SetAchievement method in the steamworks module. If you’re getting an error or unexpected behavior, you might want to check the documentation or source code of the steamworks module to see if it requires byte strings.