Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

Achievements granted only after closing the game.

Open MoctezumaDev opened this issue 1 year ago • 1 comments

I recently was playing a game and their achievements came on screen as overlay as I was getting them.

But in my current implementation with Steamworks.NET my achievements are granted but they only show up until I close the game.

I checked the documenation and the only thing that seems to be relevant is to be making a call to

SteamAPI.RunCallbacks();

Maybe I'm missing something.

MoctezumaDev avatar Jul 01 '24 12:07 MoctezumaDev

Sounds like you're likely having Steam Overlay issues, or perhaps just not firing StoreStats after giving achievements (this call causes achievements/stats updates to upload immediately).

Simple checklist:

  • run SteamAPI.RestartAppIfNecessary at startup so that if your game was run outside of Steam, it is shutdown and run from Steam instead (which runs the overlay in the process unless it has been disabled by user)
  • run SteamAPI.Init at startup (after restart check)
  • regularly call SteamAPI.RunCallbacks (like from your Update cycle)
  • call SteamUserStats.SetAchievement then SteamUserStats.StoreStats when you want an achievement to pop (assuming the current user doesn't already have it)

If you're doing this and the achievements still don't pop while you're in-game, try to open the overlay manually (Shift+Tab by default). If it does not come up, your game is almost certainly doing something to interfere with it.

KelsamGames avatar Jul 01 '24 22:07 KelsamGames

Hi, I just was able to confirm the issue... I was missing the call to SteamUserStats.StoreStats.

Thanks for the clear check list. :)

MoctezumaDev avatar Jul 03 '24 09:07 MoctezumaDev