Since many people asked about typed in coversation, i wanted to share it all of you.
This is called a typed in conversation or simply known as reply the character through dialogues.
This can be used in specific ways denpending on your game.
Note this is made by me, i hope this haven't been made yet, or maybe made it just today.
This also been familiarized to DDLC game named Monika's After Story or like that.
Maybe that is where you can speak to her whatever it is.
Note i didn't copied it, i made this by myself.
First, copy this. (Whatever where you want.)
Code: Select all
define user_input=[]
Code: Select all
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.
a "You didn't type anything! You have to ask a question first."
jump user
Here is the main one, where what word you should type in, the Charac will talk back at you.
Code: Select all
if user_input in ['Hello!', 'Hello', 'hello!', 'hello']:
###Put it in like...
a "Oh hi! How are you?"
jump user
To make it more advanced, here it is, if you want to put more of them.
Code: Select all
if user_input in ['Hello!', 'Hello', 'hello!', 'hello']:
###Put it in like...
a "Oh hi! How are you?"
jump user
elif user_input in ['I love you!', 'I love you', 'i love you!', 'i love you']:
a "I love you too! Hugs and kisses! <3"
jump user
....And so on.
This is special, if you didnt implement a keyword, the character will say this instead...
(Note, make sure to PLACE this one in the very bottom of the labels above, or else it may break the dialogues.)
Code: Select all
label untype:
$ randdiag = renpy.random.randint(1, 10)
show m think with dissolve
if randdiag == 1:
a "That word is invalid..."
jump user
elif randdiag == 2:
a "Wywisjdow is not a word!"
jump user
Code: Select all
init:
$ import time
$ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
Code: Select all
if user_input in ['What time is it?','what time is it?']:
show a normal with dissolve
a "The current time is [hour]: [minute]: [second]."
jump user
Code: Select all
if month == 12 and day == 25:
if user_input in ['Merry christmas!','merry christmas!','merry christmas','Merry christmas','Merry christmas alia!','merry christmas alia!','merry christmas alia','Merry christmas alia','Merry christmas Alia!','merry christmas Alia!','merry christmas Alia','Merry christmas Alia']:
show a happyclosed with dissolve
a "Merry christmas too [name]! Its good to talk to you this season!"
jump user
else:
if user_input in ['Merry christmas!','merry christmas!','merry christmas','Merry christmas','Merry christmas alia!','merry christmas alia!','merry christmas alia','Merry christmas alia','Merry christmas Alia!','merry christmas Alia!','merry christmas Alia','Merry christmas Alia']:
show a concerned with dissolve
a "Umm.. i think its not christmas yet, you can wait."
jump user
Also, a specifical answering.
Code: Select all
default goodmorning = False
Code: Select all
if user_input in ['Good morning','good morning','good morning!','Good morning!']:
$ goodmorning = True
show a happyclosed with dissolve
a "Good morning! Have you drank some water before you wake up? Say yes if you are."
jump user
if goodmorning:
if user_input in ['yes!','yes','Yes!','Yes']:
show a normal 2 with dissolve
a "Very good! Keep doing on that, so you will be stay hydrated."
$ goodmorning = False
jump user
if user_input in ['no','No','Nope','nope','not yet','Not yet']:
show a think with dissolve
a "I see, then drink alot of it, it is recommended everyday!"
$ goodmorning = False
jump user
And finally, a randomize conversation, this makes the character bit bored when you didn't type anything, the character will give you advices, game guides... etc...
Code: Select all
if user_input in ['random','Random']:
$ randadvice = renpy.random.randint(1, 20)
show a normal 2 with dissolve
if randadvice == 1:
a "I really love candies, you know?"
jump user
elif randadvice == 2:
a "Come on, say anything, ask anything!"
jump user
elif randadvice == 3:
a "Hmm? Whaddaya keep staring at me?"
jump user
elif randadvice == 4:
a "Im bored, wanna talk something?"
jump user
else:
a "How are you? Anything to do?"
jump user
I hope you find it helpful to use it, i made alot of effort on doing it.
Have fun coding!