Achievements for Ren'Py
A downloadable asset pack
Overview
Easily include achievements for your Ren'Py game, with support for both in-game achievements as well as built-in Steam integration.
This code is also available on GitHub!
Features
- Declare achievements with a name, description, and icon for achievement popups and an achievement gallery
- The name and description can be hidden until the achievement is unlocked (or just the description)
- Provide an alternate description to be used before the achievement is unlocked
- Provide an image to be used for the locked images of all achievements, or specify a unique image for any individual achievement
- Compatible with translations
- Track progress towards an achievement with a stat. Can be displayed in the achievement gallery as a number (e.g. 5/12 chapters completed) and as a bar showing completion percent (or both!)
- Tracks the time the achievement was unlocked at, so you can display the timestamp in the achievement gallery
- Built-in support for displaying a popup when an achievement is granted
- An optional configuration value lets you toggle whether the in-game popup appears when the Steam backend is detected or not (so you can avoid the player seeing two popups, if you want) or whether it's disabled altogether
- Supports displaying multiple achievement popups at once, with offsets
- Provides all the backend functions as the built-in achievement module in Ren'Py, as well as screen action variants (e.g.
action your_achievement.Grant())
- Built-in achievement gallery with several layout examples. Fully customizable to your needs
- Includes an action for developers to toggle achievements on and off by clicking them in the achievement gallery for testing
- Optional configuration value to provide a callback which is called with the Achievement object when it is granted
- Included LinkedAchievement class lets you use this callback to set up achievements which automatically trigger when some subset of achievements are granted - can be used to set up a "platinum" achievement which is granted when all achievements are unlocked
Instructions
Download achievements.zip and unzip it. Place the two provided rpy files into your project's game/ folder. To immediately test the achievements, make a button to go to the achievement gallery e.g.
textbutton _("Achievements") action ShowMenu("achievement_gallery")
You will see the gallery with four example achievements. Clicking an achievement during development will toggle granting and clearing it, so you can see the popup.
achievement_backend.rpy contains the essentials for the game to run. achievements.rpy contains the information you can modify yourself, such as updating the screens or declaring achievements. Several examples are provided.
A simple achievement might look like:
define bad_ending = Achievement( name=_("Dream Crusher"), id="dream_crusher", # Used for Steam backend! description=_("See the bad ending"), unlocked_image="gui/achievements/bad_ending.png" )
You can then grant this achievement in-game via:
$ bad_ending.grant()
Compatibility
This system has been tested for compatibility with Ren'Py 7.5-7.6 and 8.0-8.2. It is expected to be compatible with earlier versions as well but has not been tested. Leave a message in the stickied thread if you run into any bugs.
Terms of Use
You may:
- Use this code in commercial and noncommercial projects
- Modify and edit the code to suit your needs
You may not:
- Resell all or part of the code as-is or sell it with modifications
- Release any projects created using this code without providing attribution
Attribution must be credited as Feniks, with a link either to the page with this code or to https://feniksdev.com
Final Notes
If you're looking for systems to add extras to your game, you might also be interested in my multi-touch gallery:
Follow me to be informed of future tools! Consider also looking at my other Ren'Py tools, which I've added to a collection here: https://itch.io/c/3491447/my-renpy-tools. I also release tutorials on my website, https://feniksdev.com
A new tutorial on my website is also available! This tutorial will walk you through how to put together images to make AlphaMasks in Ren'Py, and includes examples of masks for my Layered Image Masks tool. Find the tutorial here!
Status | Released |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (11 total ratings) |
Author | Feniks |
Genre | Visual Novel |
Made with | Ren'Py |
Tags | Graphical User Interface (GUI), Kinetic Novel, Modular, Ren'Py, User Interface (UI) |
Average session | A few seconds |
Languages | English |
Download
Click download now to get access to the following files:
Development log
- SFX Update + Steam bug fix!Nov 06, 2023
- Progress Timestamp Bug FixOct 31, 2023
- Platinum AchievementsSep 19, 2023
- GitHub link + small fixSep 18, 2023