first name, last name submit box at same time

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.
Post Reply
Message
Author
User avatar
plushi
Newbie
Posts: 4
Joined: Fri Jul 03, 2015 11:10 pm
Contact:

first name, last name submit box at same time

#1 Post by plushi » Sun Jul 05, 2015 12:14 pm

i am very new to python and it is a miracle that i got this far without asking for help.
how the heck do i put two screen input submit boxes simultaneously?

for example, i want the first name and last name submit box to appear at the same time. i have it where they show up one at a time. i want them next to each other.
*BONUS,, how do i remove the text box for this part as weLL bc "hide window" doesnt work*

renpy.rpy

Code: Select all

    $ first_name = renpy.input("","Jamie", length=10)or _("Jamie")
    $ lastName = renpy.input("","Williams", length=10)or _("Williams")
screens.rpy

Code: Select all

screen input(prompt):

    window style "input_window":
        has vbox xalign 0.34 yalign -2.1

        text prompt style "input_prompt"
        input id "input" style "input_text" color "#000"

    use quick_menu 
ImageImage

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

Re: first name, last name submit box at same time

#2 Post by SinnyROM » Sun Jul 05, 2015 12:22 pm

This cookbook thread may be able to help you: http://lemmasoft.renai.us/forums/viewto ... 51&t=31289

User avatar
plushi
Newbie
Posts: 4
Joined: Fri Jul 03, 2015 11:10 pm
Contact:

Re: first name, last name submit box at same time

#3 Post by plushi » Sun Jul 05, 2015 12:24 pm

i actually looked at that! again i am very new at python so some of this stuff went over my head orz

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: first name, last name submit box at same time

#4 Post by trooper6 » Sun Jul 05, 2015 12:27 pm

If you are very new at Python, I heartily recommend taking the Python beginner's course as codeacademy.com
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
plushi
Newbie
Posts: 4
Joined: Fri Jul 03, 2015 11:10 pm
Contact:

Re: first name, last name submit box at same time

#5 Post by plushi » Sun Jul 05, 2015 12:31 pm

trooper6 wrote:If you are very new at Python, I heartily recommend taking the Python beginner's course as codeacademy.com
oooo thanks i'll definitely sign up. thank you!
for now i hope someone can still answer my question!

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: first name, last name submit box at same time

#6 Post by trooper6 » Sun Jul 05, 2015 12:46 pm

The post SinnyROM linked to is the answer to your question.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
plushi
Newbie
Posts: 4
Joined: Fri Jul 03, 2015 11:10 pm
Contact:

Re: first name, last name submit box at same time

#7 Post by plushi » Sun Jul 05, 2015 3:09 pm

trooper6 wrote:The post SinnyROM linked to is the answer to your question.
i spent hours on this code. i looked at it, i added it in, i messed with it, googled for more help, i'm stumped, i guess i'll just leave it how it is :(

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

Re: first name, last name submit box at same time

#8 Post by SinnyROM » Sun Jul 05, 2015 3:53 pm

Have you tried just the code they provided in a new game to see if it works and does show both input boxes?

I took a closer look at the thread, and it does mention you need to fill in a few holes, like how to submit and move on:
It's up to you how you continue from the text input, but it's tested and works.
That can be fixed by adding a button to the screen name_input() that jumps to another label (or returns if you called the screen).

So if you call the screen like this:

Code: Select all

label start:
    "Enter your name"
    call screen name_input
    "Your name is [firstname] [lastname]"
Add this to the screen:

Code: Select all

    textbutton "Done" action Return()
If you get any errors, please post the complete traceback so it's easier for others to help troubleshoot the issue.

Even though the Python functionality is complete in this cookbook and there's no need to do any more on it, I agree with trooper6 and would recommend the Codecademy course on Python: it's interactive and teaches a lot of invaluable information on Python.

Post Reply

Who is online

Users browsing this forum: Ocelot