You can use the "progress" function to report progress, but it currently doesn't seem to affect the Steam backend (the stats used for Steam achievement progress when not mid-game). If you register an achievement with a progress amount, "progress" can also unlock the achievement once Ren'Py tracks full completion, which does synchronize. (Maybe in the future progress will also sync? But for now, the stats in the Steam backend are only for visual purposes at best.)
However, if you need multiple conditions for an achievement, you may want to make a function specifically for such achievements. Such as "CheckAllEndsSeen()" being called at each ending to see if the conditions are met. Then, it's just basic programming logic within the function.
Since it's hard to build in a method for an achievement with multiple conditions to unlock, you may need to do it manually. If you just need a number, register and progress may be able to help. The rest has to be made custom.
Short version:
- register has a value that sets the max progress
- progress affects the internal stat and the visual display mid-game, but not the Steam stat
- any condition that isn't just incrementing a number needs to use custom achievement-granting logic
Does that help any?
Edit: To elaborate a bit further, here's some sample code for doing basic stat tracking for an achievement.
Code: Select all
## somewhere in an init block
achievement.register("ach_prologue", stat_max=3) ## sets an achievement called "ach_prologue" to unlock at 3 points of progress
## when we finish part 1 of the prologue
achievement.progress("ach_prologue", 1) ## set prologue completion to 1/3. only does anything if status is below 1
## a mini-function for incrementing achievement progress
def achievement_progress_increment(name, amount):
fval = achievement.get_progress(name) + amount
achievement.progress(name, fval)
return fval ## if you want a return value for error checking/debugging