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.
Hello. In my project I use a gallery of replays in the standard way, ie the scenes are locked until the player sees them at least once. From then on, he can see the replay whenever he wants. For this, I use "locked = none", as in the line below:
But besides the replays, I also want to put some special scenes in the same gallery. For this, I use locked = True, since I do not want the player to have immediate access to these special scenes:
The problem: the replay stays locked forever. How do I place a conditional statement above so that "locked=True" if variable x=0 and "locked=False" if x=1?
Any python conditional expression can return True or False, so you basically just want a test that evaluates True only when you want it locked.
On PyTom's example, the function renpy.seen_label("event_1") is a utility that simply returns True or False if a named label has been seen.
Personally (for simplicity) I'd tend to directly use a variable in your inline code that uses True/False (note the capitals and no "" quotes) and is True when lock is active, then just: