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.
So we're very new to Renpy, and this is the first semi-complicated bit of code we've tried. I think we've done the equivalent of 1+1=3 with these options, so...help?
Basically, we want to drop in some easter eggs for the story the game is based on (reactions are placeholders, of course). So, if a player enters "Character X", they get a line of dialogue referencing that character.
(Also, can we do something like? (Showing the sprite would be great to add extra flavour).
#This is where you put the codes.
$ name1 = "Stef"
$ name2 = "Vincent"
$ name3 = "Magnolia"
name = renpy.input(_("Vincent lost the paperwork, what was your name again?"))
$ name = player_name.strip()
# If the player can't be bothered to choose a name, then we
# choose a suitable one for them:
if player_name == "":
$ player_name="Bob"
if input == name1:
"This can't be good."
elif input == name2:
"Of course it is."
elif input == name3:
"I had a dream like that once."
ryinth wrote: ↑Fri Oct 25, 2019 2:17 am
So we're very new to Renpy, and this is the first semi-complicated bit of code we've tried. I think we've done the equivalent of 1+1=3 with these options, so...help?
Basically, we want to drop in some easter eggs for the story the game is based on (reactions are placeholders, of course). So, if a player enters "Character X", they get a line of dialogue referencing that character.
(Also, can we do something like? (Showing the sprite would be great to add extra flavour).
#This is where you put the codes.
$ name1 = "Stef"
$ name2 = "Vincent"
$ name3 = "Magnolia"
name = renpy.input(_("Vincent lost the paperwork, what was your name again?"))
$ name = player_name.strip()
# If the player can't be bothered to choose a name, then we
# choose a suitable one for them:
if player_name == "":
$ player_name="Bob"
if input == name1:
"This can't be good."
elif input == name2:
"Of course it is."
elif input == name3:
"I had a dream like that once."
label naming:
python:
name = renpy.input(_("Anything! But real names i really wanted."))
name = name.strip() or __("Student")
#######################################################
if name in ['Facter','Facter']:
show m shocked with dissolve
m "True name. You can enter!!"
jump game
if name in ['Loli','loli']:
show m think with dissolve
m "My friend had this name, im so sorry, try again!"
jump naming
I am a friendly user, please respect and have a good day.