Page 1 of 1

How to detect if a user has obtained a Steam achievement

Posted: Fri Mar 11, 2022 6:20 am
by thirstyoctopus
Hi everyone

I'm working on extra content for my game, Bistro Days, that is already released on Steam. The problem is, this extra content is a side story that is only available to players who have completed the main game (and, in turn, obtained an achievement from Steam to determine the girl who's heart they won).

My first thought was to add a persistent variable at the very end of the last chapter (as long as it's the good end) to set that the player has completed the game in order to unlock the special story, but this is essentially useless if the player has already competed the game before the new content is added - I don't want to have to force the player to play through again, or at least from their last save.

My question is, how can I detect if the user has obtained a specific Steam achievement, so I can then go ahead and unlock the new content for them if they download it AFTER completing the main story?

Thanks
Michael

Re: How to detect if a user has obtained a Steam achievement

Posted: Fri Mar 11, 2022 6:55 am
by Ocelot
First of all: Steam achievements are not a good way to measure anything. They can be unlocked without doing anything, they might not be unlocked even if user earned them (I often play VNs in offline mode, so online achievements are not unlocked reliably.). You might want later to distribute your game outside of Steam...

Probably the better way would be do like Umineko did it: lock it if you cannot determine if player finished the game, but allow unlocking it by clicking on it, warning user about consequences.

If you still want to do this through achivements, documentation has your back: https://www.renpy.org/doc/html/achievem ... vement.has

Re: How to detect if a user has obtained a Steam achievement

Posted: Fri Mar 11, 2022 7:51 am
by thirstyoctopus
Ocelot wrote:
Fri Mar 11, 2022 6:55 am
First of all: Steam achievements are not a good way to measure anything. They can be unlocked without doing anything, they might not be unlocked even if user earned them (I often play VNs in offline mode, so online achievements are not unlocked reliably.). You might want later to distribute your game outside of Steam...

Probably the better way would be do like Umineko did it: lock it if you cannot determine if player finished the game, but allow unlocking it by clicking on it, warning user about consequences.

If you still want to do this through achivements, documentation has your back: https://www.renpy.org/doc/html/achievem ... vement.has
Thanks for your response. Who is Umineko? I assume what you mean is a button that unlock the extras regardless of game completion? Since I am not the publisher of the game (only the dev) I'm not sure he would like it done. But I do see your point about the achievments not being the most reliable. Is there a way to read data in a save file though instead?

Re: How to detect if a user has obtained a Steam achievement

Posted: Fri Mar 11, 2022 9:04 am
by Ocelot
thirstyoctopus wrote:
Fri Mar 11, 2022 7:51 am
Who is Umineko?
Umineko no naku koro ni (Umineko: when seagulls cry) is a episodic VN. Unlock warning looks like that: https://i.imgur.com/fe1W8c7.jpeg
thirstyoctopus wrote:
Fri Mar 11, 2022 7:51 am
I assume what you mean is a button that unlock the extras regardless of game completion? Since I am not the publisher of the game (only the dev) I'm not sure he would like it done. But I do see your point about the achievments not being the most reliable. Is there a way to read data in a save file though instead?
There is no easy way to extract something from savefile, unless you have written that into savefile for easy retrieval. If you update game right now to start recording received endings (seriously, I am surprised that it is not done yet, this is, like, a staple of VNs from at least 90s), and only those who completed game before that update would be forced to replay the game, when you will eventually release update in the future.

Re: How to detect if a user has obtained a Steam achievement

Posted: Fri Mar 11, 2022 10:46 am
by thirstyoctopus
I think the unlock option is not the best one in my case.

My save files have bespoke information in them so as long as the info in there matches the correct ending variables I could use that.

There is a variable that determines the character who's route you're on but it's not persistent. I didn't realise this story relied so heavily on the character the player chose - truth be told, I didn't write the VN I only coded it so didn't think I needed any specific persistent data. However, thank you for your help and I think I have some info to help me work something out