Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
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.
Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Pretty much what it says as the title, is this something you can do? As far as I can tell it isn't, and I've messed around with it a lot, but I figured I'd ask before throwing in the towel.
And in case it isn't entirely clear what I mean, I mean having a character's name on here instead of the empty narrator, like they're asking you to enter text
And in case it isn't entirely clear what I mean, I mean having a character's name on here instead of the empty narrator, like they're asking you to enter text
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
You can easily fake it.
You can go into screens.rpy to add a character's name as part of the input screen. (You can copy the namebox stuff over from the say screen.)
You can go into screens.rpy to add a character's name as part of the input screen. (You can copy the namebox stuff over from the say screen.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Could you show me how that code should look? I'm using the legacy GUI so I'm not sure if what I'm using is the same as what you're using, and I don't have a full comprehension of how the say screen code works enough to confidently know what needs to be copy pasted or where it needs to go...
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Hi,
I'm trying to do the same...
I want one of my characters to ask 'What is your name?' but I'm not sure how to do this.
E.g.
This:
Jenna
What is your name?
[Player types here]
Rather than:
What is your name?
[Player types here]
Thanks in advance.
I'm trying to do the same...
I want one of my characters to ask 'What is your name?' but I'm not sure how to do this.
E.g.
This:
Jenna
What is your name?
[Player types here]
Rather than:
What is your name?
[Player types here]
Thanks in advance.
-
- Newbie
- Posts: 10
- Joined: Tue Apr 23, 2019 1:18 am
- Completed: >10 html5/canvas javascript browser games
- Organization: eroticinteractivegames.com
- Location: Glasgow, Scotland
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Bump. 5 years later, this is what google brings me to, and it isn't answered. I'd like a character with name and left side image (all of which sorted, and I know how to to the standard input too) to ask for the input instead of the narrator. No solution? I'll google some more ...
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Also interested since bublé came up.... I should check out the info on this...
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
- Sirifys-Al
- Newbie
- Posts: 9
- Joined: Sat Apr 20, 2024 3:55 pm
- Contact:
- m_from_space
- Eileen-Class Veteran
- Posts: 1011
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Normally, the "input" screen is doing the work here. You can find it inside <screens.rpy>. So depending on what you want, you either change that screen, making sure it has a namebox that shows the name of a specific character, or you create your own screen and tell that when using renpy.input()...Sirifys-Al wrote: ↑Sat Apr 20, 2024 4:01 pmHave you found a solution yet? I would really like to know!
I advice you to make your own custom screen, so to not alter the original input screen, whenever you need it. Here is what you can do:
Code: Select all
screen myinput(prompt):
style_prefix "input"
window:
if prompt[0]:
window:
style "namebox"
text prompt[0]
vbox:
xanchor gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt[1] style "input_prompt"
# this field with this specific id is necessary for the custom input screen
input id "input"
label start:
"So Eileen finally took a chance..."
# Whenever you use renpy.input for the custom screen, don't just use a prompt string,
# but a list that contains a name and then the prompt
$ mc_name = renpy.input(["Eileen", "What is your name?"], screen="myinput")
e "[mc_name]!??? That's so cute!!"
- Sirifys-Al
- Newbie
- Posts: 9
- Joined: Sat Apr 20, 2024 3:55 pm
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Thank you very much! Somehow I haven't thought that I can just chande the screen...m_from_space wrote: ↑Sat Apr 20, 2024 6:25 pm
Normally, the "input" screen is doing the work here. You can find it inside <screens.rpy>. So depending on what you want, you either change that screen, making sure it has a namebox that shows the name of a specific character, or you create your own screen and tell that when using renpy.input()...
I advice you to make your own custom screen, so to not alter the original input screen, whenever you need it. Here is what you can do:
Code: Select all
screen myinput(prompt): style_prefix "input" window: if prompt[0]: window: style "namebox" text prompt[0] vbox: xanchor gui.dialogue_text_xalign xpos gui.dialogue_xpos xsize gui.dialogue_width ypos gui.dialogue_ypos text prompt[1] style "input_prompt" # this field with this specific id is necessary for the custom input screen input id "input" label start: "So Eileen finally took a chance..." # Whenever you use renpy.input for the custom screen, don't just use a prompt string, # but a list that contains a name and then the prompt $ mc_name = renpy.input(["Eileen", "What is your name?"], screen="myinput") e "[mc_name]!??? That's so cute!!"
Edited: oh, one more question: with this code, will I be able to set things like input length, allowed characters and so on?
- m_from_space
- Eileen-Class Veteran
- Posts: 1011
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Yes, Renpy handles all of this as part of the renpy.input() function, so you can just pass the usual keyword arguments like "length", "exclude", "mask"... at least I hope it won't raise some exception because the prompt is not just a string anymore. But even then you could change the input screen using a string prompt, which we then just split up into a list or something, extracting the name of the speaking person.Sirifys-Al wrote: ↑Sat Apr 20, 2024 6:26 pm Edited: oh, one more question: with this code, will I be able to set things like input length, allowed characters and so on?
- Sirifys-Al
- Newbie
- Posts: 9
- Joined: Sat Apr 20, 2024 3:55 pm
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Yeah, me too...m_from_space wrote: ↑Sat Apr 20, 2024 6:41 pmYes, Renpy handles all of this as part of the renpy.input() function, so you can just pass the usual keyword arguments like "length", "exclude", "mask"... at least I hope it won't raise some exception because the prompt is not just a string anymore.Sirifys-Al wrote: ↑Sat Apr 20, 2024 6:26 pm Edited: oh, one more question: with this code, will I be able to set things like input length, allowed characters and so on?
- m_from_space
- Eileen-Class Veteran
- Posts: 1011
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
I mean it works on my end, but I didn't test any edge cases. But here is how you would do it not using a list, but a string:Sirifys-Al wrote: ↑Sat Apr 20, 2024 6:43 pmYeah, me too...m_from_space wrote: ↑Sat Apr 20, 2024 6:41 pmYes, Renpy handles all of this as part of the renpy.input() function, so you can just pass the usual keyword arguments like "length", "exclude", "mask"... at least I hope it won't raise some exception because the prompt is not just a string anymore.Sirifys-Al wrote: ↑Sat Apr 20, 2024 6:26 pm Edited: oh, one more question: with this code, will I be able to set things like input length, allowed characters and so on?
Code: Select all
screen myinput(prompt):
default prompt_list = prompt.split("|")
...
label start:
$ name = renpy.input("Eileen|What is your name?", screen="myinput")
- Sirifys-Al
- Newbie
- Posts: 9
- Joined: Sat Apr 20, 2024 3:55 pm
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Thanks!m_from_space wrote: ↑Sat Apr 20, 2024 6:48 pmI mean it works on my end, but I didn't test any edge cases. But here is how you would do it not using a list, but a string:Sirifys-Al wrote: ↑Sat Apr 20, 2024 6:43 pmYeah, me too...m_from_space wrote: ↑Sat Apr 20, 2024 6:41 pm
Yes, Renpy handles all of this as part of the renpy.input() function, so you can just pass the usual keyword arguments like "length", "exclude", "mask"... at least I hope it won't raise some exception because the prompt is not just a string anymore.
Code: Select all
screen myinput(prompt): default prompt_list = prompt.split("|") ... label start: $ name = renpy.input("Eileen|What is your name?", screen="myinput")
- Sirifys-Al
- Newbie
- Posts: 9
- Joined: Sat Apr 20, 2024 3:55 pm
- Contact:
Re: Is it possible for the renpy.input dialogue to be said by a character and not the narrator?
Thanks to @m_from_space, I've made this:
Code: Select all
screen bubble_input(prompt):
style_prefix "bubble"
frame:
style "bubble_window"
background Frame("gui/thoughtbubble2.png", 55, 55, 55, 55) #your bubble
xalign .5 #bubble's x
yalign .5 #bubble's y
xsize 431 #bubble's width
ysize 150 #bubble's height
vbox:
xalign 0.5 #makes the text inside the bubble centered
text prompt[0] style "bubble_who" #name of the character who says it
hbox:
text prompt[1] style "bubble_what" #the words the char says
input id "input" style "bubble_what" #the input goes here
##############################################################################################
label s2:
$ name = renpy.input(["Some character", "My name is "], screen="bubble_input", default="Charname") #you can also add suchparameters as allowed symbols, name's maximum length, etc.
Who is online
Users browsing this forum: Bing [Bot]