Steam Achievements

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
Eyzi
Regular
Posts: 32
Joined: Fri May 15, 2015 12:43 am
Organization: Moonlit Works
Discord: Eyzi#3994
Contact:

Steam Achievements

#1 Post by Eyzi »

I have a question regarding implementing Achievements.

It says that "If Steam support is available and enabled, achivement (misspelled in the docs, btw) information is automatically synchronized with Steam." This means that when I grant an achievement with a name, it will handle Steam unlocking of the same name, right?

In my script, I've added the line:

Code: Select all

$ achievement.grant("TRUE_END")
I have set an achievement on Steamworks with the API name "TRUE_END", but whenever I reach that line, the achievement doesn't seem to unlock.

About the game, all files are archived (archive.rpa) if that means anything. It is not released yet, so achievements don't appear on the Steam store page, but they do on the Library tab. I've asked in the Steam forum and I've been told that this shouldn't stop me from unlocking achievements.

Am I implementing this incorrectly? I would appreciate any help.

Side question: The game lags so hard when opening Steam overlay. Is this normal? Or is something wrong with my files? Or is it just my computer?
Image

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Steam Achievements

#2 Post by Divona »

When you set and save achievement, have you publish them as well? You'll need to publish in order to test things like your game depot configuration, new builds, or new achievements you've added.
viewtopic.php?f=8&t=44797&p=459741&hili ... nt#p459741

The forum is right. Archive have nothing to do or affect Steam.

I have no issue with game lag when open Steam overlay. Have you tried it on another computer? Do other games lag when open Steam overlay?
Completed:
Image

mikolajspy
Regular
Posts: 169
Joined: Sun Jun 04, 2017 12:05 pm
Completed: Too many, check signature
Deviantart: mikolajspy
Location: Wrocław, Poland
Contact:

Re: Steam Achievements

#3 Post by mikolajspy »

Did you tried to delete persistent data? Sometimes it might cause troubles.
You can also try to add achievement.register somewhere.

User avatar
Eyzi
Regular
Posts: 32
Joined: Fri May 15, 2015 12:43 am
Organization: Moonlit Works
Discord: Eyzi#3994
Contact:

Re: Steam Achievements

#4 Post by Eyzi »

Thanks for the reply Divona! I really appreciate it. I just finished making changes.

The changes for achievements have been published. I can confirm this as I can see the achievements in my Library. All unlocked.

I have also added

Code: Select all

init python:
     achievement.Sync()
at the top of my scripts.rpy. I have also added $ achievement.Sync() after everytime I call $ achievement.grant(name).

Code: Select all

     $ achievement.grant("PROLOGUE")
     $ achievement.Sync()
Rebuilt and re-uploading the new build on the depot, and reinstalled the game in my library. Still, it does not unlock. I was wondering if there's a setting I missed or something. My Ren'Py version is 6.99.11.1749 if that's a necessary information.

The Steam overlay lag comes and goes. Sometimes it's normal, sometimes it lags. For other games, it doesn't lag at all.

Have a great day!
Image

User avatar
Eyzi
Regular
Posts: 32
Joined: Fri May 15, 2015 12:43 am
Organization: Moonlit Works
Discord: Eyzi#3994
Contact:

Re: Steam Achievements

#5 Post by Eyzi »

mikolajspy wrote: Sat Sep 23, 2017 2:33 am Did you tried to delete persistent data? Sometimes it might cause troubles.
You can also try to add achievement.register somewhere.
Before building distributions, I always delete persistent and force recompile. I even make sure that I remove the 'save' folder before I upload the build.

If it's relevant, I'm also having a problem with setting initial config for the volumes. I have config.default_channel_volume = 0.5, but whenever I play it on a fresh install, it always sets all channel volumes to max. I figured it was something to do with the persistent data.

I'll try to add $ achievement.register("name") right before the grant function and see if that changes anything.

Edit: adding $ achievement.register("name") did not fix it, sadly. :(
Image

mikolajspy
Regular
Posts: 169
Joined: Sun Jun 04, 2017 12:05 pm
Completed: Too many, check signature
Deviantart: mikolajspy
Location: Wrocław, Poland
Contact:

Re: Steam Achievements

#6 Post by mikolajspy »

Eyzi wrote: Sat Sep 23, 2017 2:41 am The changes for achievements have been published. I can confirm this as I can see the achievements in my Library. All unlocked.
If they're already unlocked, they won't appear again I think. I had this issue, and I simply deleted and added again achievements on Steam dev page.

If that's not it, check if you have correct steam_appid.txt file, what's inside and where's the file.

As for music, you can try putting this code in the beginning of options.rpy:

Code: Select all

define config.default_music_volume = 0.5
define config.default_sfx_volume = 0.5
It should stay at 0.5 regardless of persistent data.

User avatar
Eyzi
Regular
Posts: 32
Joined: Fri May 15, 2015 12:43 am
Organization: Moonlit Works
Discord: Eyzi#3994
Contact:

Re: Steam Achievements

#7 Post by Eyzi »

Ah, my bad. I meant to say they are all locked, not unlocked.
Image

User avatar
Eyzi
Regular
Posts: 32
Joined: Fri May 15, 2015 12:43 am
Organization: Moonlit Works
Discord: Eyzi#3994
Contact:

Re: Steam Achievements

#8 Post by Eyzi »

Hi, guys! I have fixed the problem by simply updating to the latest Ren'Py version (6.99.12.4).

I'm not sure if this was a necessary step as well, but I downloaded a steam lib file (elided) and merged the 'lib' folder there with the 'lib' folder in the Ren'Py sdk. After that, everything worked perfectly. It also got rid of all the other issues I was having.

Thanks to everyone who replied and helped! I really appreciate it.
Last edited by PyTom on Fri Dec 15, 2017 1:38 am, edited 1 time in total.
Reason: Elided link due to Steam rules.
Image

Post Reply

Who is online

Users browsing this forum: No registered users