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.
# The script of the game goes in this file.
# Declare characters used by this game. The color argument colorizes the
# name of the character.
define e = Character("Eileen")
# The game starts here.
label start:
"Welcome to My Awesome Game!"
call age_verification_prompt
# Show a background. This uses a placeholder by default, but you can
# add a file (named either "bg room.png" or "bg room.jpg") to the
# images directory to show it.
scene bg room
# This shows a character sprite. A placeholder is used, but you can
# replace it by adding a file named "eileen happy.png" to the images
# directory.
show eileen happy
# These display lines of dialogue.
e "You've created a new Ren'Py game."
e "Once you add a story, pictures, and music, you can release it to the world!"
# This ends the game.
return
label age_verification_prompt:
$ age_prompt = False # Initialize the variable to False initially
menu:
"Are you 18 years old or older?":
"Yes":
$ age_prompt = True # Set the variable to True if the user selects "Yes"
"No":
$ age_prompt = False # Keep the variable as False if the user selects "No"
if age_prompt:
return # Continue with the game if age_prompt is True
else:
"Sorry, you must be 18 or older to play this game."
"Goodbye!"
return # Exit the game
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 41: expected statement.
"Yes":
^
File "game/script.rpy", line 43: expected statement.
"No":
^
Ren'Py Version: Ren'Py 8.1.3.23091805
Sun Jan 7 03:10:02 2024
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 40: Line is followed by a block, despite not being a menu choice. Did you forget a colon at the end of the line?
"Are you 18 years old or older?"
^
Ren'Py Version: Ren'Py 8.1.3.23091805
Sun Jan 7 11:18:19 2024