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.
I'm trying to make an if statement so that a previous dialogue choice influences dialogue later in the game. However, I keep getting an error message that the first if statement has not been defined, and not the other two.
menu:
"Who ARE you people?!":
jump whoARE
"What was all that just now?":
jump whatwasallthat
"Were you talking about games to them just now?":
jump talkingaboutgames
if whoARE:
mc "{cps=20}What did Nene mean by you guys \"Looking for excitement in your lives\"? How do you do that with video games?"
if whatwasallthat:
mc "{cps=20}Nene said she was trying to persuade me for something earlier... Why exactly do you need more members for a video game club in a high school?"
if talkingaboutgames:
mc "{cps=20}Nene was acting kind of weird when I asked her if you guys were whispering about games earlier, said something about the best games in the world? And also, were you whispering about games earlier, or something else?"
default my_variable = "none"
label start:
menu:
"Who ARE you people?!":
$ my_variable = "who?"
jump new_label
"What was all that just now?":
$ my_variable = "what?"
jump new_label
"Were you talking about games to them just now?":
$ my_variable = "games"
jump new_label
label new_label:
"[my_variable]"
If this still isn't what you are after, you'll need to give a different example of what you want to accomplish.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
scene cat2
with dissolve0
c "Just be true to yourself. But take it rather slow. It'll all work out."
if $ m_love >= 13:
c "Espically your wife"
i "What do you mean \"it'll all work out?\" How can I trust something that literally told me it was a hallucination?"
c "I don't know. You're the crazy one. Figure it out."
c "I'll see you again soon."
c "Maybe..."
Maybe you can solve this, I can get the if statement to work.
Currently working on Taboo Hearts
Currently working on Forbidden
scene cat2
with dissolve0
c "Just be true to yourself. But take it rather slow. It'll all work out."
if m_love >= 13:
c "Espically your wife"
i "What do you mean \"it'll all work out?\" How can I trust something that literally told me it was a hallucination?"
c "I don't know. You're the crazy one. Figure it out."
c "I'll see you again soon."
c "Maybe..."
Maybe you can solve this, I can get the if statement to work.
You had a space in "with dissolve0"
You also don't need the $ when checking python variables.
You did "default" the variable before the start label, right?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.