Steam Achievement Issues

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Social_Mechanic
Newbie
Posts: 8
Joined: Fri Feb 21, 2025 2:34 am
Contact:

Steam Achievement Issues

#1 Post by Social_Mechanic »

Hello!

I'm having issues with my achievements. They work fine in my VN's native achievement tracker and display, but not on Steam itself. I'll try to include all the relevant details below.

I first want to say that I've read the Ren'Py achievement documentation and even followed VND's achievement video on YouTube.

First off, I have the Steam ID in the options.rpy (I changed the number in the code below):

Code: Select all

## Steam APP ID
define config.steam_appid = 1234567
I registered the achievements (I'll only show four of them here):

Code: Select all

## Register Achievements
init python:
    achievement.register("Completed_Act_1")
    achievement.register("Completed_Act_2")
    achievement.register("Completed_Act_3")
    achievement.register("Completed_Act_4")
I created some persistent variables that I need to check:

Code: Select all

## Variables
default persistent.has_achievement = True
default persistent.has_all_achievement = False
default persistent.achievement_total = 0
default i_achieve = str(None)
default i_achieve_tag = str(None)
I then have a label that I call in the script to run when I want to grant an achievement:

Code: Select all

## Achievement Label 
label grantAchievement(a="error"):
    $ i_achieve_tag = str(a)
    call achieveText()
    if achievement.has(str(a)):
        $ persistent.has_achievement = False
    $ achievement.grant(str(a))
    $ achievement.sync()
    if persistent.has_achievement == True:
        $ persistent.achievement_total += 1
        show screen achievement()
    $ persistent.has_achievement = True
    $ achievement.progress("Earned_All_Achievements", persistent.achievement_total)
    if persistent.achievement_total >= 12:
        if not achievement.has("Earned_All_Achievements"):
            show screen achievement()
        $ achievement.grant("Earned_All_Achievements")
    $ achievement.sync()
    return
A lot is going on here, but the 'i_achieve_tag', the 'achieveText', and the 'screen achievement' are all part of a screen that pops up when you earn an achievement (I primarily do this because the VN is also on itch.io, not just Steam). So, you can ignore those parts (unless they are impacting why it isn't working for me).

Also, a chunk of the label includes the "Earned_All_Achievements" stuff, just to track how many achievements the reader has earned and to grant the final achievement once 12 have been earned.

Lastly, in the script, I have this line of code to give the reader their earned achievement

Code: Select all

call grantAchievement("Completed_Act_1")
Everything seems to work because the native achievement screen pops up and informs the reader they have earned the achievement. In the main menu, the reader can access the achievement tracker, and the tracker will indicate that the reader has the achievement.

Of course, the problem here is that the Steam indicator doesn't pop up, and the reader never earns the achievement according to Steam.

In-game, I bring up the console to be sure the achievement is being awarded, and it is.

In Steamworks under the Achievement Configuration settings, I have the achievements with their correct names (For example "Completed_Act_1" [without the quotes]), with the 'Set By' set to 'Client'.

Lastly, I have 'Steam Support' installed via Ren'Py preferences.

Why isn't this working for me!! T~T

EDIT: Still not working, but I have done some additional things to add to the list.

First, I've added the position of Steam notifications with the following:

Code: Select all

init python:
    achievement.steam_position = "bottom right"
Next, I added the 'steam_appid.txt' file in the actual VN's base folder (which contains the Steam game ID as listed in the 'define config.steam_appid'). I also added the 'steam_api.dll' and 'steam_api64.dll' files, which I got from the most recent version of the Steamworks SDK, and placed them into the 'game' folder.

After doing all of this, it is still not working...
Last edited by Social_Mechanic on Fri May 09, 2025 9:16 pm, edited 5 times in total.

User avatar
enaielei
Miko-Class Veteran
Posts: 546
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Steam Achievement Issues

#2 Post by enaielei »

It's been so long since I've touched Steam Achievements, but from what I can recall:
1. You need to use the name specified under the "API Name" column of your Steam Achievement Configuration page when calling .grant method.
-> 1.1 You can verify this by going into the console and typing achievement.has(...) to see if it exist.
2. I don't recall using achievement.register, you can probably leave that one out.
3. Set the achievement.steam_position, it's None by default so I think that means don't display the pop up.
4. Make sure you have Steam running in background when launching the game.
5. Also, I think it makes sense to make a check before calling any of the methods that connects with Steam using the achievement.steam boolean.

Bonus:
If you're using persistent to track your achievements locally, better call renpy.save_persistent() right after updating the variables. Because persistent changes are only saved if the game is exited properly.

References:
https://www.renpy.org/doc/html/achievem ... m_position
https://partner.steamgames.com/doc/feat ... /ach_guide
Please consider supporting me if you like what I do :D
https://paypal.me/enaielei?country.x=PH&locale.x=en_US

User avatar
Social_Mechanic
Newbie
Posts: 8
Joined: Fri Feb 21, 2025 2:34 am
Contact:

Re: Steam Achievement Issues

#3 Post by Social_Mechanic »

enaielei wrote: Fri May 09, 2025 7:20 pm It's been so long since I've touched Steam Achievements, but from what I can recall:
1. You need to use the name specified under the "API Name" column of your Steam Achievement Configuration page when calling .grant method.
-> 1.1 You can verify this by going into the console and typing achievement.has(...) to see if it exist.
2. I don't recall using achievement.register, you can probably leave that one out.
3. Set the achievement.steam_position, it's None by default so I think that means don't display the pop up.
4. Make sure you have Steam running in background when launching the game.
5. Also, I think it makes sense to make a check before calling any of the methods that connects with Steam using the achievement.steam boolean.

Bonus:
If you're using persistent to track your achievements locally, better call renpy.save_persistent() right after updating the variables. Because persistent changes are only saved if the game is exited properly.

References:
https://www.renpy.org/doc/html/achievem ... m_position
https://partner.steamgames.com/doc/feat ... /ach_guide
1) I'm pretty sure I'm already doing that, correct? And, if it wasn't actually granting the achievement, it wouldn't trigger the native achievement screen (as far as I'm aware).
2) You have to do this with collective achievements that count and have a stat_max
3) Oooooh okay. This I was not aware of. I'll give this a shot.
4) I'm actually playing it through Steam.

EDIT: It didn't work but I added everything I did at the bottom of the original post.

User avatar
enaielei
Miko-Class Veteran
Posts: 546
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Steam Achievement Issues

#4 Post by enaielei »

You're saying you're playing the published game through the Steam app? Are you sure you're keeping your uploaded build updated with the current changes that you just did?
Also, FYI, if you're not aware, you can test all of this through the Ren'Py Launcher by just keeping Steam open in the background.

I don't recall adding those files that you mentioned, maybe it's needed and It's getting hard to remember.

And as suggested, it's better to do a simple check using achievement.has without the register stuff in the console to see if does return True.
Please consider supporting me if you like what I do :D
https://paypal.me/enaielei?country.x=PH&locale.x=en_US

User avatar
Social_Mechanic
Newbie
Posts: 8
Joined: Fri Feb 21, 2025 2:34 am
Contact:

Re: Steam Achievement Issues

#5 Post by Social_Mechanic »

enaielei wrote: Fri May 09, 2025 8:09 pm You're saying you're playing the published game through the Steam app? Are you sure you're keeping your uploaded build updated with the current changes that you just did?
Also, FYI, if you're not aware, you can test all of this through the Ren'Py Launcher by just keeping Steam open in the background.

I don't recall adding those files that you mentioned, maybe it's needed and It's getting hard to remember.

And as suggested, it's better to do a simple check using achievement.has without the register stuff in the console to see if does return True.
The game is not public, but I can access the most recent build through Steam in my developer account (I've been uploading new builds each time). That said, I did not know I didn't have to do all that, so thank you for letting me know.
I'm not sure how to bring up the console, but I'll figure it out. That said, again, I feel like the achievements will be working via True/False because the native achievement system I have is working just fine.

EDIT: I brought up the console and checked the achievement before and after the point it is supposed to be awarded. It went from True to False, so it is working as intended.

User avatar
enaielei
Miko-Class Veteran
Posts: 546
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Steam Achievement Issues

#6 Post by enaielei »

I did more reading on the achievements doc.
It says that the config.steam_appid will be automatically set by Ren'Py. So I think you can try leaving that out.

Additionally, check also this achievement.steam in the console. See if it's true. Because the doc says it tells when the Steam support was initialized. If not then this is most likely the reason why you're not able to sync with Steam.
I was wrong with the achievement.has, I forgot that it's about checking whether the user has the achievement or not, I thought it's supposed to check if you have the achievement registered in your Steam Achievement Configuration page.

Other than these, I don't think I can give more suggestions.
I even checked the previous game that I did where I implemented this stuff. And what before were all from that.
Please consider supporting me if you like what I do :D
https://paypal.me/enaielei?country.x=PH&locale.x=en_US

User avatar
Social_Mechanic
Newbie
Posts: 8
Joined: Fri Feb 21, 2025 2:34 am
Contact:

Re: Steam Achievement Issues

#7 Post by Social_Mechanic »

enaielei wrote: Fri May 09, 2025 9:45 pm I did more reading on the achievements doc.
It says that the config.steam_appid will be automatically set by Ren'Py. So I think you can try leaving that out.

Additionally, check also this achievement.steam in the console. See if it's true. Because the doc says it tells when the Steam support was initialized. If not then this is most likely the reason why you're not able to sync with Steam.
I was wrong with the achievement.has, I forgot that it's about checking whether the user has the achievement or not, I thought it's supposed to check if you have the achievement registered in your Steam Achievement Configuration page.

Other than these, I don't think I can give more suggestions.
I even checked the previous game that I did where I implemented this stuff. And what before were all from that.
In the console, when I type in 'achievement.steam' it comes up as 'None'.
I'm assuming that's the problem. How exactly do I fix that?

User avatar
enaielei
Miko-Class Veteran
Posts: 546
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Steam Achievement Issues

#8 Post by enaielei »

Maybe try reinstalling the Steam Support from the Ren'Py Launcher?

And just to confirm, since you're testing this in the Steam App:
rebuild the game -> reupload the build to Steam -> set that uploaded build as the current build -> completely exit steam and relaunch -> you should see the game gets an update that can be downloaded
Please consider supporting me if you like what I do :D
https://paypal.me/enaielei?country.x=PH&locale.x=en_US

User avatar
Social_Mechanic
Newbie
Posts: 8
Joined: Fri Feb 21, 2025 2:34 am
Contact:

Re: Steam Achievement Issues

#9 Post by Social_Mechanic »

enaielei wrote: Sat May 10, 2025 12:25 am Maybe try reinstalling the Steam Support from the Ren'Py Launcher?

And just to confirm, since you're testing this in the Steam App:
rebuild the game -> reupload the build to Steam -> set that uploaded build as the current build -> completely exit steam and relaunch -> you should see the game gets an update that can be downloaded
Yes, exactly. That's what I've been doing.
I'll see if I can reinstall the Steam Support. Thank you for all your help.

EDIT: That didn't work either... Oof...

Post Reply