Page 1 of 1

Open-Ended Diologe Boxes

Posted: Mon May 18, 2020 12:21 am
by Paul Kinsella
Dear Awesome Ren'py experts,
I have done a thorough google search before posting my question. I searched for the following terms: "open-ended Text Input renpy", "open ended dialog box Text Input renpy", "Text input box for dialogue in renpy", and many others. All results ran dry or perhaps I simply did not know what I was looking for.
Here is my question...
I once had a collection of games I wrote in HTML/DHTML that I later converted into FLASH games called the "STICKMAN MURDER MYSTERIES". Now I want to convert to Ren'py. One of the cool things that DHTML and FLASH let me do was create Open-Ended Dialogue Boxes. They were blank boxes players could type into and click a button. This would trigger a "jump to".

For example, in the game, the player would see the city in map form with only a few places of interest showing. In the game the player is unaware that the motive for the murder they are investigating involves a bank at "4010 Parker St". I had the dialog box, set so if the player typed in "4010" or "Parker" they would be taken to the bank. If they typed in "zoo" they would go to the zoo. Etc...
I used this in other parts of the games such as interviews with witnesses and the like. If you typed something and hit "enter" - this triggered a change or response.
Is there something like this in ren'py?
I'm aware of "Text Input" that can be used to "give a player their name". But I have not found Open-Ended Dialogue Boxes. If something like that exists, please let me know where I can find a functional example of the code so I (and others) can learn how use it.
Thank you, in advance, for your help. :D

Re: Open-Ended Diologe Boxes

Posted: Mon May 18, 2020 1:25 am
by isobellesophia
Ah, what a good time on showing my own script into the same thing...

Is this what you've been looking for?

viewtopic.php?f=51&t=57908

There, you can learn it from here, i made this script a few months ago.

Re: Open-Ended Diologe Boxes

Posted: Mon May 18, 2020 3:25 am
by Paul Kinsella
Great! I think your script is what I've been looking for. Unfortunately I was not able to get it to work. I've posted a question on that thread at viewtopic.php?f=51&t=57908 that I'm hoping you can answer. :D

Re: Open-Ended Diologe Boxes

Posted: Fri Jul 03, 2020 11:12 am
by Paul Kinsella
NOTE: Isobellesophia has helped me to generate the following code and Isobellesophia deserves the credit.
This code ATTEMPTS to create a "replying through dialogue box" where a player can type words and, depending on what those words are, is taken to a given page or specific dialogue appears. For example, in the code below, if the player types in something related to cows (such as "cow","cows","milk",etc...) the dialogue response is "That is not my cow.". If the player says a greeting (such as "hello", "hi", "howdy", etc...) the dialogue response is "Hi. Do you want to ask me anything?" If the player types in "sword of power" the dialogue response is "What!?!?!??!" and the player is jumped to a new page.
Unfortunately the code does not fully work yet...
If the player types in gibberish such as "asgdfds3gh", the player jumps to the new page.
If the player goes "off script" and types something like "I like cats.", the player jumps to the new page.
Even if the player uses one of the correct words such as "cow" but uses it in a sentence (with other words) such as "That cow is fat." or "Can I buy your cow?", the player jumps to the new page rather than getting the dialogue response of "That is not my cow.".
If this code can be made to work properly, it would become an enormous asset to all of us! :D
I am a novice. My coding skills are very limited. Therefore a demonstration showing the code fully altered would be much appreciated.

Code: Select all

define user_input=[]
label start:
    "Welcome!"
label user:
    $ user_input = renpy.input(prompt = "Type anything you want!", allow="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ /.,'?!")
    $ user_input=user_input.lower().strip()
    if user_input == "": #This will happen if there's no input.
        "You didn't say anything. You must be the strong siolent type."
        jump user
if user_input in ['hello','Hello','hi','Hi','howdy','Howdy','yo','Yo']:
        "Hi. Do you want to ask me anything?"
        jump user
elif user_input in ['cow','cows','Cows','Cow','milk','Milk']:
        "That is not my cow."
        jump user
elif user_input in ['sword of power','Sword of Power']:
        "What!?!?!??!"
        jump other
label other:
    "You know of the sword of power? You must be the 'chosen one' bla bla bla..."
    "The End"
    return