Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
init python:
# If persistent.endings is None (the first pass through the game), then make it a set.
if persistent.endings is None:
persistent.endings = set()
Also I would prefer, persistent.endings to be a list (persistent.endings = []) instead of a set (persistent.endings = set()) I guess. so you would use .append instead .add when adding an ending name and use .remove instead of .discard when removing an ending name. But that depends, if you don't want any duplicate endings then you're right about using a set, list doesn't care for duplicate items.
init python:
# If persistent.endings is None (the first pass through the game), then make it a set.
if persistent.endings is None:
persistent.endings = set()
Also I would prefer, persistent.endings to be a list (persistent.endings = []) instead of a set (persistent.endings = set()) I guess. so you would use .append instead .add when adding an ending name and use .remove instead of .discard when removing an ending name. But that depends, if you don't want any duplicate endings then you're right about using a set, list doesn't care for duplicate items.