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! I'm new to both Ren'Py and coding. I'm trying to work with an if statement and variables. I want the player to go through all three menu choices before being able to move on with the game. So far, I have the following code, but the game just loops the menu over and over again.
# Define varbles
default hasFish = False
default hasCat = False
default hasPlant = False
# The game starts here.
label start():
"Your game has started."
menu diningRoom:
"Think on memories?"
"Fish" if not hasFish:
jump fish
"Cat Painting" if not hasCat:
jump catpainting
"Plant" if not hasPlant:
jump plant
"All three memories collected. Continue on." if hasFish and hasCat and hasPlant:
jump theNextScene
return
label fish():
$hasFish = True
"Fish"
jump diningRoom
label catpainting():
$hasCat = True
"cat painting"
jump diningRoom
label plant():
$hasPlant = True
"plant"
jump diningRoom
label theNextScene():
"The game continues on."
return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
In addition to trooper6 answer: Source of your problem is your jumps aftermenu item labels. You are jumping directly to menu, completely skipping check for memory.