Make a prompt box like Mettaton's essay

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
Rekoija
Newbie
Posts: 15
Joined: Wed Nov 20, 2019 3:19 pm
Contact:

Make a prompt box like Mettaton's essay

#1 Post by Rekoija »

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! :D
Last edited by Rekoija on Sun Jan 19, 2020 1:04 pm, edited 2 times in total.

User avatar
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

#2 Post by isobellesophia »

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
I am a friendly user, please respect and have a good day.


Image

Image


Rekoija
Newbie
Posts: 15
Joined: Wed Nov 20, 2019 3:19 pm
Contact:

Re: Make a prompt box like Mettaton's essay

#3 Post by Rekoija »

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 :D


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?

User avatar
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

#4 Post by isobellesophia »

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!']:
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: Google [Bot]