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.
# This starts the input for the player's name.
$ name = renpy.input("What is your name?")
$ name = name.strip()
if name == "":
$ name="Jonathan"
"You can create anything in this world. Pleased to meet you, [name]!"
# This ends the input of player's name.
So let's say I key in "Jack", as long as there is [name]. The name will appear.
But how do I get the name appear in the name of the dialog box?
Attachments
Last edited by Trafagal on Tue May 26, 2020 9:04 pm, edited 1 time in total.
define pov = Character("[povname]")
python:
povname = renpy.input("What is your name?")
povname = povname.strip()
if not povname:
povname = "Pat Smith"
pov "My name is [povname]!"
define pov = Character("[povname]")
python:
povname = renpy.input("What is your name?")
povname = povname.strip()
if not povname:
povname = "Pat Smith"
pov "My name is [povname]!"
Thank you iDweadith! Do i put this in scrypt.renpy itself?
define pov = Character("[povname]")
label start:
python:
povname = renpy.input("What is your name?")
povname = povname.strip()
if not povname:
povname = "Pat Smith"
pov "My name is [povname]!"