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.
Hello
I belive it's not possible because "jump" is a language from Ren'py and when you put the python: keyword that's mean you use the python language. I don't know what's the code of your label invalidname, but you must write your function under your "if condition".
label start:
"Welcome to the game"
$ player = renpy.input("What's your name ? \n ")
if player == "Player":
"Invalid name!"
$ renpy.quit()
"Thank you [player]"
return
Maybe something like this ???
It's not necessary to define a function for that, you can add it below the player input.
init -1 python:
def HasName():
if player == "Player":
renpy.jump ("invalidname")
renpy.jump() is the python equivalent of jump.
Python equivalents are used inside python blocks to emulate renpy statements (well, a bit more intricated than this, but that's the use logic).
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
init -1 python:
def HasName():
if player == "Player":
renpy.jump ("invalidname")
renpy.jump() is the python equivalent of jump.
Python equivalents are used inside python blocks to emulate renpy statements (well, a bit more intricated than this, but that's the use logic).
That works well! Thank you so much you are a life saver.
The other solutions sadly didn't work for me. When I wrote some text under def its just not printed it. dunno why
init -1 python:
# this is a python block, you must use python statemente equivalents
label start:
# this is a renpy block, you can use normal renpy statements
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.