Hi, I'm looking for a way for players to type anything on the keyboard and the screen to display more of a creator-written message as the player types. They don't need to type what is written on the message; I'd like for players to be able to type in "asfhkahfkf" or "oidfijjfnf" and still get the same message.
I don't want a delay such as when getting typical user input for names and such. Just keypress any letter = one letter of the message. If you've played Emily is Away, that's exactly what I'd like to do (https://games.renpy.org/game/emily-is-away).
Is there a way to do this in Ren'Py? Thanks in advance
How to let players "type" pre-written message (like Emily is Away)?
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.
-
- Newbie
- Posts: 4
- Joined: Wed Oct 18, 2017 1:18 pm
- Contact:
- Ocelot
- Lemma-Class Veteran
- Posts: 2401
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: How to let players "type" pre-written message (like Emily is Away)?
My first thought is to show custom screen with all keys bound to "show next letter" fucntion.
< < insert Rick Cook quote here > >
-
- Newbie
- Posts: 4
- Joined: Wed Oct 18, 2017 1:18 pm
- Contact:
Re: How to let players "type" pre-written message (like Emily is Away)?
Could you provide me an example of creating a "show next letter" function, if it's not too much trouble? Thanks for replying
- Ocelot
- Lemma-Class Veteran
- Posts: 2401
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: How to let players "type" pre-written message (like Emily is Away)?
Something like:
Code: Select all
default message = ""
default rest_of_message = "I am message"
init python:
def next_letter():
global message
global rest_of_message
message += rest_of_message[0]
rest_of_message = rest_of_message[1:]
screen my_message():
text message
key "p" action Function(next_letter)
# rest of keys
< < insert Rick Cook quote here > >
-
- Newbie
- Posts: 4
- Joined: Wed Oct 18, 2017 1:18 pm
- Contact:
Re: How to let players "type" pre-written message (like Emily is Away)?
Thank you Ocelot! Sorry for the late reply, I didn't see this till now ^^" I tried it out and it works just like I wanted, thanks again for your help
Who is online
Users browsing this forum: bloodzy