[Solved] Question On Using Screen Input
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.
- inahochama
- Regular
- Posts: 39
- Joined: Tue Dec 15, 2009 12:38 am
- Contact:
[Solved] Question On Using Screen Input
I know this is going to sound really silly but I'm really at a loss. After a player types/inputs a string using the screen input, how should I define that string as the player's name in the game? I know the answer is here but I keep hitting walls in all my search today orz
Last edited by inahochama on Tue Sep 20, 2011 5:08 am, edited 1 time in total.
- inahochama
- Regular
- Posts: 39
- Joined: Tue Dec 15, 2009 12:38 am
- Contact:
Re: Question On Using Screen Input
Alex wrote:This should help - http://www.renpy.org/wiki/renpy/doc/ref ... cCharacter
Thank you for replying, but I've tried that one before and I know it works but I was hoping to use the screen input better. I mean I understood the screen input, at least I think I do but I can't seem to understand how I'm supposed to use and define the input name/string itself as the player's name and such. Here's the code.
script.rpy
Code: Select all
# Declare characters used by this game.
define player = #don't know what to do on this part
# The game starts here.
label start:
show screen bg image
show screen input
$ renpy.pause ()
player "blah blah blah"
return
Code: Select all
screen input:
hbox xalign .5 yalign .5:
text "Name:"
input id "input"
use quick_menu
-
- Miko-Class Veteran
- Posts: 636
- Joined: Thu May 14, 2009 8:15 pm
- Projects: Castle of Arhannia
- Contact:
Re: Question On Using Screen Input
okay, so firstly, I'm not sure if the define character method is any different when it comes to dynamic characters. If not something like the following code should work:
then later you just set playername equal to the input given with the following code:
the input screen included by default in screens.rpy is meant for customizing how you want to display the prompt that pops up when you use the renpy.input() function. you shouldn't try to call it manually.
Code: Select all
define player = DynamicCharacter("playername")
Code: Select all
$ playername = renpy.input()
- inahochama
- Regular
- Posts: 39
- Joined: Tue Dec 15, 2009 12:38 am
- Contact:
Re: Question On Using Screen Input
"facepalms" that actually made sense why I can edit the screen input but not know what to do with the "input" thing itself. I thought I can manually just call it without having to deal with renpy.input in the label start (I knew how to use it but I thought I can just have screen input do it or something). Thank you for clearing that up.KimiYoriBaka wrote: the input screen included by default in screens.rpy is meant for customizing how you want to display the prompt that pops up when you use the renpy.input() function. you shouldn't try to call it manually.
Who is online
Users browsing this forum: Jackkel Dragon