I have a problem that I cant sum up in a subject line.

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.
Post Reply
Message
Author
User avatar
AlHallowed
Newbie
Posts: 9
Joined: Fri Oct 23, 2015 2:46 pm
Projects: Children's Games
Organization: All Hallowed Games
Contact:

I have a problem that I cant sum up in a subject line.

#1 Post by AlHallowed » Fri Oct 23, 2015 3:07 pm

Sorry if I'm posting this is in the wrong place or it has been discussed before.
I have a really weird issue.
A friend and I are making a visual novel and in one of the story branches I want to give the player the opportunity to enter some text and if they enter the right word they get a secret ending.
I know how I want to have the player enter the text, with an input line that changes an empty variable, but if you can figure out a better way it is more than welcome.
My issues is that I cant figure out how to get the game to recognize the word that was saved into the variable.
Here's the code I have right now that doesn't work:

Code: Select all

## In the script.rpy file.
init:
    $ word = ""

## In the file for the story branch where the code can be put in:
“Filler Text.”
$ word = renpy.input(_("Input Word"))
"Filler Text"
if word is fish:
    jump secret_end

##Example secret end label
label secret_end:
“These are some words.”
“You just read them, thank you for that”
If this isn't clear enough then I can try to explain further but that's the best I have right now.

User avatar
Jae
Regular
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY
Contact:

Re: I have a problem that I cant sum up in a subject line.

#2 Post by Jae » Fri Oct 23, 2015 3:27 pm

I haven't tested, but put quotes around fish?"

Code: Select all

if word == "fish":
    jump secret_end

User avatar
AlHallowed
Newbie
Posts: 9
Joined: Fri Oct 23, 2015 2:46 pm
Projects: Children's Games
Organization: All Hallowed Games
Contact:

Re: I have a problem that I cant sum up in a subject line.

#3 Post by AlHallowed » Fri Oct 23, 2015 5:21 pm

Yes, that worked, thank you so much. I had actually tried that before and it didn't work but the problem is that i used

Code: Select all

if word is "fish"
instead of

Code: Select all

if word == "fish"
Thanks again.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], _ticlock_