I've been struggling for a while trying to figure out the best way to do this thing but now I'm stuck and need some advice.
My game includes three characters, each has their own good ending (and bad ending). I need to set up a persistent variable for when an ending is achieved so it knows who's route they've successfully completed.
Currently I'm using the RevertableSet persistent method which I think suits best. I set my persistent up as follows (the names in the object being the names of the characters whose ending you can achieve):
Code: Select all
if persistent.seen_ending is None:
persistent.seen_ending = set({'lily','rose','iris'})Code: Select all
def merge_endings(old, new, current):
current.update(old)
current.update(new)
return current
renpy.register_persistent('seen_ending', merge_endings)Code: Select all
$ persistent.seen_ending.lily = TrueCode: Select all
if persistent.seen_endings.rose:
// do something hereThanks
Michael