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.
I actually tried to figure this out a while back, but I never came upon a working solution!
Basically, my current game relies heavily on inputting text at various points. It's supposed to appear as though MC is asking questions, and PLAYER must type in their answer to continue. I've gotten as far as having the input text display at the same speed as regular dialogue, along with having quotation marks around it. It's nearly perfect, but I can't seem to figure out how to have MC's name appear above the input text, as it would for standard dialogue.
It kind of ruins the effect I'm going for when MC's name disappears every time the player gets to an input screen. I would very much appreciate some assistance with figuring this out!
label firstspell:
$ res = renpy.input( Text( _('"Just...let me know if you find anything, okay?"'), slow_cps=40.0) ).strip()
if res == "":
jump firstspell1
elif res != "123":
jump wrongspell1
if res == "123":
jump gjob
Last edited by Offworlder on Sat Feb 09, 2019 10:17 am, edited 1 time in total.
Offworlder wrote: ↑Sat Feb 09, 2019 6:31 am
---
but I can't seem to figure out how to have MC's name appear above the input text, as it would for standard dialogue.
It kind of ruins the effect I'm going for when MC's name disappears every time the player gets to an input screen. I would very much appreciate some assistance with figuring this out!
label firstspell:
$ res = renpy.input( Text( _('"Just...let me know if you find anything, okay?"'), slow_cps=40.0) ).strip()
if res == "":
jump firstspell1
elif res != "123":
jump wrongspell1
if res == "123":
jump gjob
I'm not sure if this is what you are looking for, but you could use a screen, something like that.
label firstspell:
show screen name("John")
$ res = renpy.input( Text( _('"Just...let me know if you find anything, okay?"'), slow_cps=40.0) ).strip()
if res == "":
hide screen name
jump firstspell1
elif res != "123":
hide screen name
jump wrongspell1
if res == "123":
hide screen name
jump gjob
label firstspell:
show screen name("John")
$ res = renpy.input( Text( _('"Just...let me know if you find anything, okay?"'), slow_cps=40.0) ).strip()
if res == "":
hide screen name
jump firstspell1
elif res != "123":
hide screen name
jump wrongspell1
if res == "123":
hide screen name
jump gjob
Thanks for the quick reply!
I tried out your code, and it seems to be at least close to what I'm going for. I discovered one major issue while playing around with the positioning, though. The name screen goes behind the text box, rather than sitting on top of it like MC's name should.
default whoinput = None
screen input(prompt, who=whoinput):
style_prefix "input"
window:
####<<
if who is not None:
window:
style "namebox"
text who size gui.name_text_size
####<<
vbox:
xalign gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt style "input_prompt"
input id "input"
$ whoinput variable controls the name of the person asking the question through input().You're gonna have to change it manually. For example:
IrinaLazareva wrote: ↑Sat Feb 09, 2019 8:24 am
another option: rewrite the input() screen:
That does exactly what I'm looking for!
...Unfortunately, it doesn't seem to work in combination with another addition to the input screen I already had in place. x_x
default whoinput = None
screen input(prompt, who=whoinput):
style_prefix "input"
window:
if who is not None:
window:
style "namebox"
text who size gui.name_text_size
vbox:
xalign gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt style "input_prompt"
input id "input"
transform blink_tr():
alpha 1.5
linear 1.1 alpha 0.3
linear 1.1 alpha 1.0
repeat
screen input(prompt):
style_prefix "input"
window:
vbox:
xalign gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt style "input_prompt"
hbox:
input id "input"
text ">" at blink_tr
input id "input"
style input_prompt is default
style input_prompt:
xalign gui.dialogue_text_xalign
properties gui.text_properties("input_prompt")
style input:
xalign gui.dialogue_text_xalign
xmaximum gui.dialogue_width
There's a blinking icon below the input dialogue to alert PLAYER they'll need to enter something. If I put your code above the icon code, MC's name doesn't appear. If I put it below the icon code, MC's name appears, but the icon does not.