• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Steam Steam Achievements/API

Tommah

Member
I'm trying to implement achievements in my Steam game and looked through all the documentation and found this.

Code:
if !steam_get_achievement("ach_Player_Dies_Ten_Times") steam_set_achievement("ach_Player_Dies_Ten_Times");
(yes, I have changed the achievement names to fit my own)
But also saw that I need to wait until "steam_stat_ready" returns true but it never does, it only returns -1.

This is listed in the "steam_stat_ready" page to check if everything is initialized correctly
Code:
global.steam_api = false;
if steam_initialised()
{
if steam_stats_ready() && steam_is_overlay_enabled()
{
global.steamapi = true;
}
}
but it NEVER comes back true and none of my achievements work. I can't find any other documentation or thread that discusses this any further so I am completely confused.
 
Last edited:

johnwo

Member
Are you been accepted onto steam?
Do you have the steamworks SDK set up?
Have you gotten assigned a app-ID?

If not, you can't use it.

If you're still having problems, then check the documentation again. Here.

Cheers!
 

Tommah

Member
Are you been accepted onto steam?
Do you have the steamworks SDK set up?
Have you gotten assigned a app-ID?

If not, you can't use it.

If you're still having problems, then check the documentation again. Here.

Cheers!
Yes, my game is already released as Early Access on Steam, I'm just trying to add achievements to it. Also that link just brings me to the same page I was referring to. I've read the documentation all the way through about 10 times but I still don't understand either how to use "steam_stats_ready()" or why its never set to true so that I can set achievements.

I don't mean to sound ungrateful because I'm not, but I already mentioned that its a Steam game and I already mentioned I looked through the documentation so I'm asking if I'm doing something wrong or if something is messed up.
 

johnwo

Member
I'm sorry if my post made it sound like you weren't aware of this, but the OP could be misconstrued as "I'm making a game for steam."

First off, the steam overlay can be disabled by the user.

I would recommend that you check it by using show_debug_message(steam_initialised()), show_debug_message(steam_is_overlay_enabled()) and show_debug_message(steam_stats_ready()) to pinpoint the problem.

Best of luck!

Cheers!
 

Tommah

Member
Thank you for the clarification, I'll try to word it better next time.
Since I don't have access to the compiler window while running through Steam, I just did a simple "draw_text" to track them.
Code:
steam_initialised() = 0
steam_is_overlay_enabled() = -1
steam_stats_ready() = -1
I am running it on my own computer through steam with the overlay turned on. Is there something else I need to put at the beginning of the game to activate all this? Because it seems like its just not detecting steam at all.

*Edit*
OH MY GOD, I'm an idiot. I didn't set the Steam Global Game Settings..... working just fine now
 
Last edited:
G

Gabriel Otavio

Guest
Hey guys, I have the same here.

I checked 'Enable Steam' and put 'Steam App ID' correctly on 'Global Game Settings'.
I Put the 'Steamworks SDK' on Preferences and it is checkd ok
On Steamworks I create the depot and compile the game.

When I try run the game on Steam, I got these values:

steam_initialised() = 0
steam_is_overlay_enabled() = -1
steam_stats_ready() = -1

Could you help-me?

Thank you so much!
 
G

Gabriel Otavio

Guest
Solved

I use the version 133b of SDK.

You will need compile your GMS project as .ZIP, and extract it on content folder.

After that, go to sdk\redistributable_bin folder and copy do steam_api.dll to content folder.
 
C

Claudio

Guest
Which version of game maker studio were you using? I'm using v1.4.1567, and I can't find the 'Enable Steam' option and where to put 'Steam App ID' correctly on 'Global Game Settings'
 
C

Claudio

Guest
Ok, I just realized I needed the professional version...but now that I have it, after following the above steps I have these values:

steam_initialised() = 0
steam_is_overlay_enabled() = -1
steam_stats_ready() = -1

Global Game Settings are fine (steam enabled, ID inserted), steam_api.dll is in the content folder...what could be the problem?
 
C

Claudio

Guest
Everything solved after installing the latest version of game maker studio from steam
 
M

Michael Schmidt

Guest
I am trying to do the same thing, but it's not activating the achievements. First, in the initialization room, I use this code here:

var global.steam_api = false;

if steam_initialised()
{
if steam_stats_ready() && steam_is_overlay_enabled()
{
global.steam_api = true;
}
}


Then, in a game object, when it is destroyed I call this code:

if(global.steam_api == true)
{
if !steam_get_achievement("Achievement_Asteroid_Destroyer") steam_set_achievement("Achievement_Asteroid_Destroyer");
}


When I run the game, these variables all show up as 1.
steam_initialised() = 1
steam_is_overlay_enabled() = 1
steam_stats_ready() = 1

So it seems to be connecting to Steam okay. The overlay works. It says "Stats Ready" is okay. However, when I destroy the asteroid, nothing happens. I can see that there are four unlocked achievements on the Steam game.

I have the Steam App ID and SDK settings loaded into GameMaker. I'm using version 1.4.1772, when I check for updates, it says none are found, so I guess it is up to date?

On the Steam forum, they said it should activate the achievements, even though the game and store page are not up yet. Does the game and store page need to be approved before this will work?

I'm wondering if there is a step I'm missing, or what else might be happening.
 
M

Michael Schmidt

Guest
I see what I was doing wrong. I was checking whether Steam Stats were ready, but only once at the beginning of the game.

I have put it on a loop that will keep checking until it comes back as true. Now the achievements unlock when needed.
 
Top