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.
Basically, I want to make so that if the player doesn't input a name and if he is male, his name will become Jack. And if the player didn't enter a name and if she is female, her name is Sarah. I can't for the life of me see what's wrong with what I've written.
"Are you male or female?"
menu:
"Male":
$ gender = "male"
"Female":
$ gender = "female"
"What is your name?"
$ player_name = renpy.input ("What is your name?")
$ player_name = player_name.strip()
if $ gender=="male" :
if player_name == "":
$ player_name="Jack"
if $ gender== "female" :
if player_name == "":
$ player_name="Sarah"
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Thank you so much! That I fixed one problem, however, it led to another. I've been putting in the player name thing into the code like the example in the cookbook, however, it says that there is an error on the line. What would the error be?
define m = Character ( 'Me', color = "# ffffff" )
label start:
"Are you male or female?"
menu:
"Male":
$ gender = "male"
"Female":
$ gender = "female"
"What is your name?"
$ player_name = renpy.input ("What is your name?")
$ player_name = player_name.strip()
if gender=="male" :
if player_name == "":
$ player_name="Jack"
if gender== "female" :
if player_name == "":
$ player_name="Sarah"
m "My name is %(player_name). I've recently been hired as a journalist for a small-time newspaper company."