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.
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 145: python block expects a non-empty block.
python:
^
File "game/script.rpy", line 147: expected statement.
povFirstName,povLastName = povName.split(" ")
^
Ren'Py Version: Ren'Py 6.99.13.2919
This is what the engine tells me what is currently giving me an issue. If someone could help me, I would very musch appreciate it!
label nameinput:
define pov = Character("[povName]", color = "#80CE44")
$ povName = renpy.input("Please sign your name.", length=50) or "Tyler Rice"
python:
if " " in povName: #checks there is space char in name, indicating a full name.
povFirstName,povLastName = povName.split(" ")
if " " in povName:
pov "My name is [povFirstName], last name is [povLastName]. Together, it is [povName]."
else:
pov "My name is [povName]."
jump comply
label basicname:
python:
define pov = Character("[povName]", color = "#80CE44")
python:[povName] = "Tyler Rice"
if " " in povName:
povFirstName,povLastName = povName.split(" ")
jump lashout
You need to indent your code correctly. Every time you create a block you should indent the code.
That means every time you use (:) and press enter, you are creating a block, and everything inside that block should be 4 spaces to the right.
define pov = Character("[povName]", color = "#80CE44")
python:
povName = renpy.input("Please sign your name.", length=50, default="Tyler Rice")
if " " in povName: #checks there is space char in name, indicating a full name.
povFirstName,povLastName = povName.split(" ")
if " " in povName:
pov "My name is [povFirstName], last name is [povLastName]. Together, it is [povName]."
else:
pov "My name is [povName]."
I believe this piece of code will do what you want.
EDIT:
Inputting 3 or more names will break your code.