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.
-
RoboKnight
- Newbie
- Posts: 19
- Joined: Sun Feb 18, 2018 6:12 pm
-
Contact:
#1
Post
by RoboKnight » Tue Feb 20, 2018 1:41 am
In the first lines of my game, I have the player name themself. Now, in the story, the player character is later revealed to be the reincarnation of King Arthur, so I want my narration to foreshadow a little if the player inputs "Arthur". This is the code I have so far (disregard the lack of scenery I excluded for simplicity):
Code: Select all
label start:
$ player_name = renpy.input("What is your name?")
$if player_name == "Arthur":
"Ah, so perhaps you remember..."
Now then I get: "Line is indented but the preceding one-line python statement does not expect a block"
So then I remove the one tab I had and I get: "unexpected EOF when parsing" (I don't know what an EOF is).
What am I doing wrong here?
Last edited by
RoboKnight on Tue Feb 20, 2018 2:17 am, edited 1 time in total.
-
Ana
- Regular
- Posts: 61
- Joined: Sun Oct 12, 2014 5:56 pm
-
Contact:
#2
Post
by Ana » Tue Feb 20, 2018 1:59 am
Code: Select all
$ player_name = renpy.input("TEXT HERE")
$ player_name = player_name.strip()
if player_name == "Victor":
"TEXT."
elif player_name == "Riley":
"SOME MORE TEXT."
The if statement would not be indented, like in the code above, I think. You would also need to include the player_name.strip()
-
RoboKnight
- Newbie
- Posts: 19
- Joined: Sun Feb 18, 2018 6:12 pm
-
Contact:
#3
Post
by RoboKnight » Tue Feb 20, 2018 2:02 am
Yeah I realized my problem lay within having the $ where it shouldn't be. Also, is there a way to include a method like ToUpper (this is what I know it's called in the Visual Basic language at least) so that it changes the character input to all uppercase letters and then test it with "ARTHUR"? This is because the font I use is all in uppercase.
EDIT: I found a way