Page 1 of 1

(Persistent) Ren'Py Achievements w/ Download link

Posted: Mon Feb 08, 2021 1:39 pm
by Angelo Seraphim
Latest update (5 / JULY / 21)

Hello, everyone!

I've decided to make an achievement system using RenPy Achievements.
:!: UPDATE (I figured it'd be easier to create a downloadable file including a short tutorial and the code.)

:!: Here's a quick video of what it looks like in my game so you can get an idea.


Some screenshots. The first is the screen of what it looks like in my game, and the second is showing the notification displayed at the top of the screen.
616_charagma_acheivements_1.png
616_charagma_acheivements_2.png

Downloads

:arrow: Itch.io: https://glsuoa.itch.io/renpy-achievements

:arrow: Direct:
Achievements.zip
(980.54 KiB) Downloaded 94 times

If you run into any problems feel free to let me know over on Discord - @Angel Seraphim#9599

Re: Using Ren'Py Achievements and making them persist

Posted: Thu Feb 11, 2021 5:58 am
by bonnie_641
Thank you! :D
From: https://www.youtube.com/watch?v=j89RDm0nNAs

For all the trophy/achievement hunters.

This took me a long time to figure out, but I'm happy to have got it working.
If anybody is interested in learning how to create a persistent list I will create a simple walkthrough tutorial on the RenPy Lemmasoft forum soon.
It is impressive!
I watched the video and it looks great.
I really wish you would give an example of how to use each part of this wonderful tutorial (with persistent data).
I appreciate your effort and time spent.
Regards.

Re: Using Ren'Py Achievements and making them persist

Posted: Fri Feb 12, 2021 12:00 pm
by Angelo Seraphim
bonnie_641 wrote:
Thu Feb 11, 2021 5:58 am
Thank you! :D
From: https://www.youtube.com/watch?v=j89RDm0nNAs

For all the trophy/achievement hunters.

This took me a long time to figure out, but I'm happy to have got it working.
If anybody is interested in learning how to create a persistent list I will create a simple walkthrough tutorial on the RenPy Lemmasoft forum soon.
It is impressive!
I watched the video and it looks great.
I really wish you would give an example of how to use each part of this wonderful tutorial (with persistent data).
I appreciate your effort and time spent.
Regards.
Thank you!
I'm still working to perfect it.
However, I've come across a small problem where for example if you earn, let's say, 10 achievements in a "new" save and you go back to an old save those achievements don't show up, as in, they are locked as if you never earned them at all, but they are actually there, just not in older save files.

I'm looking to see how I could fix that as it may come across as concerning to see your achievements just suddenly disappear.
If anyone has any idea on how to solve this I'd be more than happy.

Re: Using Ren'Py Achievements and making them persist

Posted: Fri Feb 12, 2021 5:25 pm
by Angelo Seraphim
UPDATE 12th FEB 2021

Okay, so I've figured out the problem.

So, in the screen that displays the achievements, instead of:

Code: Select all

	## Granted trophies
	for t in Trophy.Trophies: ## Change this line...
		if achievement.has(t.name):
			...
... do:

Code: Select all

	## Granted trophies
	for t in persistent.my_victories: ## ... to this.
		if achievement.has(t.name):
			...
Use the persistent variable defined earlier. This will display the achievements correctly even after loading a save.

Re: Using Ren'Py Achievements and making them persist

Posted: Fri Feb 19, 2021 5:52 am
by bonnie_641
Thank you for updating the topic.
I will try to incorporate this into my game.
Thank you very much <3

Re: Using Ren'Py Achievements and making them persist

Posted: Mon Mar 01, 2021 4:26 pm
by Angelo Seraphim
UPDATE 4th MARCH 2021

I've done a few more testing. There are times when the achievement is rewarded but doesn't show up in the achievement screen.

The changes;
For the __eq__ you can do;

Code: Select all

	def __eq__(self, value):
		return all((self.name == value.name, self.message == value.message))
This seems to work more consistently. (Still currently testing.)

If you run into any problems feel free to let me know over on Discord - @Angel Seraphim#9599

Re: Using Ren'Py Achievements and making them persist

Posted: Fri Jun 25, 2021 3:51 am
by SiegeWizard
In the class "__init__" method, you may want to provide a "fit" property to the "Transform", as the default ("fill") will mess with aspect ratios.
  • "contain" avoids messing with aspect ratio, will use 100 for the big dimension and keep the other one the corresponding ratio (a 200x150 image will be transformed to 100x75 instead of 100x100)
  • "scale-down" does the same but if the image is already small enough it doesn't enlarge it.
https://www.renpy.org/doc/html/atl.html ... operty-fit

Re: Using Ren'Py Achievements and making them persist

Posted: Sun Jun 27, 2021 7:13 am
by Angelo Seraphim
SiegeWizard wrote:
Fri Jun 25, 2021 3:51 am
In the class "__init__" method, you may want to provide a "fit" property to the "Transform", as the default ("fill") will mess with aspect ratios.
  • "contain" avoids messing with aspect ratio, will use 100 for the big dimension and keep the other one the corresponding ratio (a 200x150 image will be transformed to 100x75 instead of 100x100)
  • "scale-down" does the same but if the image is already small enough it doesn't enlarge it.
https://www.renpy.org/doc/html/atl.html ... operty-fit
Thanks for this. I will amend the code to reflect this change. :mrgreen: