AGS Games With Achievements For Steam

Started by Ghostlady, Fri 05/09/2025 04:34:37

Previous topic - Next topic

Ghostlady

Does anyone have a step by step method on how to add achievements to a Steam game?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Danvzare

As someone who's in the process of doing the same thing, I completely understand the confusion.
Hopefully someone will correct me if I get any of the steps wrong, but this is what I've personally done so far:

Step 1: Sign up for Steamworks (there's no point in putting in Steam achievements if you can't get your game on Steam)
Step 2: In the "Edit Steamworks Settings" for your app, is a "Stats & Achievements" tab where you can define new achievements. Create a new achievement and make a note of the API name you give it.
Step 3: Download AGSteam.
Step 4: Put the AGSteam.dll and steam_api.dll into the AGS directory, the place where the editor is stored.
Step 5: Open your game in the editor and activate the AGSteam plugin, then compile your game. (I also had to copy the steam_api.dll into the compiled folder for my game, but apparently it's supposed to do that automatically. So maybe I just jumped the gun by doing that.)
Step 6: Include the following code into your game for when the achievement should be achieved, with "API_NAME" being replaced with the API name your achievement has set up in Steamworks: AGS2Client.SetAchievementAchieved("API_NAME");

And that should be it.
There's more you can do, such as wrapping the code in a function that lets you easily disable achievements for a non-Steam release. But for the most part, that should be everything.

Crimson Wizard

Quote from: Danvzare on Fri 05/09/2025 14:50:06(I also had to copy the steam_api.dll into the compiled folder for my game, but apparently it's supposed to do that automatically. So maybe I just jumped the gun by doing that.)

The Editor cannot do that automatically simply because it has no idea one is necessary. It knows about the plugin, but does not check the plugin's dependencies.

We had an issue opened for this, but it was not fixed yet:
https://github.com/adventuregamestudio/ags/issues/2239

Ghostlady

Thank you, Danvzare!  This is perfect and fantastic.  I am very appreciative to you for putting this together!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Ghostlady

#4
For step 5 do I copy the steam_api.dll right under the Compiled folder or under the Data or Windows folder?

Update: I believe I got this working.  I put the .dll in the Windows folder.

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Yesterday at 03:59:02For step 5 do I copy the steam_api.dll right under the Compiled folder or under the Data or Windows folder?

Update: I believe I got this working.  I put the .dll in the Windows folder.

Probably you should also have a second copy in your game project's root, in case you want to test Steam plugin when running the game from the editor.

Ghostlady

Quote from: Crimson Wizard on Yesterday at 11:02:38Probably you should also have a second copy in your game project's root, in case you want to test Steam plugin when running the game from the editor.

Where would I see the test results in the editor?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Yesterday at 16:59:18Where would I see the test results in the editor?

I meant, when you are running the game from the Editor with F5.

SMF spam blocked by CleanTalk