The Achievement module allows the developer to grant achievements to the player, to clear achievements, and to determine if an achievement has been granted. It also allows the recording of progress towards an achievement.
By default, the achievement stores information in the persistent file. If Steam support is available and enabled, achievement information is automatically synchronized with Steam.
Steam support must be added to Ren'Py, to ensure that it is only distributed by creators that have been accepted to the Steam partner program. To install it, choose "preferences", "Install libraries", "Install Steam Support".
achievement.
Sync
() linkAn action that calls achievement.sync(). This is only sensitive if achievements are out of sync.
achievement.
clear
(name) linkClears the achievement with name.
achievement.
clear_all
() linkClears all achievements.
achievement.
get_progress
(name) linkReturns the current progress towards the achievement identified with name, or 0 if no progress has been registered for it or if the achievement is not known.
achievement.
grant
(name) linkGrants the achievement with name, if it has not already been granted.
achievement.
has
(name) linkReturns true if the player has been granted the achievement with name.
achievement.
progress
(name, complete) linkReports progress towards the achievement with name, if that achievement has not been granted. The achievement must be defined with a completion amount.
achievement.
register
(name, **kwargs) linkRegisters an achievement. Achievements are not required to be registered, but doing so allows one to pass information to the backends.
The following keyword parameters are optional.
achievement.
sync
() linkSynchronizes registered achievements between local storage and other backends. (For example, Steam.)
Variables that control achievements are:
achievement.steam_position
= None linkIf not None, this sets the position of the steam notification popup. This must be a string, one of "top left", "top right", "bottom left", or "bottom right".
config.steam_appid
= None linkIf not None, this should be the Steam appid. Ren'Py will automatically set this appid when it starts. This needs to be set using the define statement
define config.steam_appid = 12345