If you've played Undertale and fought against Mettaton, at some point in his battle there'll be this thing where the player has to type in stuff.
If you write "has pretty legs" he will respond to the "leg" part of it with something like "Yes, leg is the correct answer."
Is it possible to make something like this in Renpy?
I've tried to look through it, but the closest I've found to the function is when you let the player name themself, and unfortunately I'm not good enough at coding to come up with anything from there.
here's a less vague description of what I want:
N1 has a secret
The Player (pc) has to guess their secret.
Pc will write in their guess
"N1 is secretly a uh... fish person, or something."
we might have a list of words for the secret, like
"merfolk"
"fish person"
"merman"
"mermaid"
since the player wrote "fish person" they guessed correctly!
i'd also like for the player to have a limited amount of letters they can write, so they can't just say every single word that exists.
thank you for reading my post
and thank you in advance for your help, should you have any!
Make a prompt box like Mettaton's essay
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 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.
Make a prompt box like Mettaton's essay
Last edited by Rekoija on Sun Jan 19, 2020 1:04 pm, edited 2 times in total.
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: Make a prompt box like Mettaton's essay
Well, im pretty sure you were talking about if statements.
Code: Select all
label user:
$ user_input = renpy.input(prompt = "Type anything! If you want to leave, say 'Later or later' Or if you want to go places, type 'Lets go somewhere'.", allow="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ /.,'?!")
$ user_input=user_input.lower().strip()
if user_input == "": #This will happen if there's no input.
"Asnwer please?"
jump user
Code: Select all
if user_input in ['merfolk']:
"Random answer"
jump user
if user_input in ['fish person']:
"CORRECT!!!"
jump user
if user_input in ['merman']:
"Random answer"
jump user
if user_input in ['mermaid']:
"Random answer"
jump user
Re: Make a prompt box like Mettaton's essay
isobellesophia wrote: ↑Sat Jan 18, 2020 11:05 pm Well, im pretty sure you were talking about if statements.
Yep, just didn't know how to write them, haha.
Thank you so much! I really appreciate it
One problem though... what if the person types
"he's a fish person or something"
then it's wrong because you wrote "he's a" "or something" in front and after
is it possible for renpy to ignore the irrelevant words?
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: Make a prompt box like Mettaton's essay
You can add or change the sentence.
Code: Select all
if user_input in ['fish person', 'he's a fish person or something', 'he is a fish!']:
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Ocelot