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.
Sorry for the vague title, but I'm not sure what to call this. What I want is for the player to have to examine both of the options, and then the door choice will be available.
label class1:
$ checked_desk = False
$ checked_window = False
scene classroominteract
menu classexplore:
"What should I do?"
"Look at the window.":
$ checked_window = True
"Why the hell is it boarded up?"
"Look at the desk.":
$ checked_desk = True
"I can't believe I fell asleep here..."
"Head to the door." if checked_desk and checked_window:
"I guess I should explore this place a bit more..."
That's the code I'm starting off with. However I need to know how to repeat the choice instead of automatically heading to the door. I'm sorry if this post doesn't make a lot of sense but I'm not sure how I can explain this well. I thought about having it jump to another label but then the variables don't seem to carry over.
Last edited by Braydxne on Wed Sep 20, 2017 8:27 pm, edited 1 time in total.
Kia wrote: ↑Wed Sep 13, 2017 12:19 am
you can put a label before your choice and jump back to it whenever you want
as for variables problem, you can use persistent variables: https://www.renpy.org/doc/html/persistent.html
This worked like a charm. I can't believe the answer was so simple. Thank you very much!
That is actually not the answer.
Persistent will persist (as the name implies) between new games.
What you want to do, is take all your defined variables and move them to before any label, and switch the $ for default.
default checked_desk = False
default checked_window = False
label start:
# the start of your game
label class1:
scene classroominteract
label examine:
menu :
"What should I do?"
"Look at the window.":
$ checked_window = True
"Why the hell is it boarded up?"
"Look at the desk.":
$ checked_desk = True
"I can't believe I fell asleep here..."
if checked_desk and checked_window:
"Head to the door.":
"I guess I should explore this place a bit more..."
jump wherever
jump examine
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.