[SOLVED] Please show me an example of 'input' to call inside the 'screen'

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
span4ev
Regular
Posts: 77
Joined: Fri Jul 08, 2022 9:29 pm
itch: rpymc
Contact:

[SOLVED] Please show me an example of 'input' to call inside the 'screen'

#1 Post by span4ev » Fri Oct 14, 2022 3:49 pm

I've been trying to find a working example for days, I've tried so many options and nothing works.
Most of the examples are for use inside the 'label'. But I need inside 'screen'.

Code: Select all

screen:
    some button ... action Show('get_name')

screen get_name:

    $ name = renpy.input ...
I am in deep, deep despair...
Last edited by span4ev on Sat Oct 15, 2022 4:57 am, edited 1 time in total.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1882
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Please show me an example of 'input' to call inside the 'screen'

#2 Post by Ocelot » Fri Oct 14, 2022 5:18 pm

I am not sure what exactly do you want.
If you want an input field within screen, there is an input screen statement and multitude of InputValues to update different kinds of variables.

If you need something else, tell exactly what do you want.
< < insert Rick Cook quote here > >

span4ev
Regular
Posts: 77
Joined: Fri Jul 08, 2022 9:29 pm
itch: rpymc
Contact:

Re: Please show me an example of 'input' to call inside the 'screen'

#3 Post by span4ev » Fri Oct 14, 2022 5:37 pm

Ocelot wrote:
Fri Oct 14, 2022 5:18 pm
I am not sure what exactly do you want.
If you want an input field within screen, there is an input screen statement and multitude of InputValues to update different kinds of variables.

If you need something else, tell exactly what do you want.
I want to call a separate 'screen' with an 'input' from another 'screen' via a button.
The problem is that most of the examples use a 'label' and not a 'screen'.
Maybe for the 'label' the examples work, but I need to display the 'input' inside the 'screen'.

The second problem is that I tried all the examples I found but they don't work.

In the documentation there is this example:

Code: Select all

input default "Joseph P. Blow, ESQ."
But this is more like a joke.

I am very sad that I could not find a working example. I don't understand why I can't find anything since it's supposed to be a primitive task that is used in almost every game

Please help. Please... Show me an example of a screen call with 'input' inside

This is what I want to get

Code: Select all

init:
    $ name = ''

screen some_1:
    textbutton 'change name' action Show('change_name')

screen change_name:
    $ name = input()

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1882
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Please show me an example of 'input' to call inside the 'screen'

#4 Post by Ocelot » Fri Oct 14, 2022 6:24 pm

An example of barebones input screen:

Code: Select all

default character_name = "John Doe"

screen name_input():
    modal True
    frame:
        align (0.5, 0.5)
        padding (25, 25)
        input value VariableInputValue("character_name", returnable=True)

screen some_screen():
    textbutton "Change Name" action [SetVariable("character_name", ""), ShowTransient("name_input")]


label start:
    "At this moment your name is [character_name]"
    show screen some_screen
    "Try to change it now. Proceed when you do."
    "At this moment your name is [character_name]"
    return
In addition, a working example of input screen, the one which is used by renpy.input by default if no other screen is specified when called, is input screen and it is in screens.rpy of every new project.
< < insert Rick Cook quote here > >

span4ev
Regular
Posts: 77
Joined: Fri Jul 08, 2022 9:29 pm
itch: rpymc
Contact:

Re: Please show me an example of 'input' to call inside the 'screen'

#5 Post by span4ev » Sat Oct 15, 2022 4:55 am

Ocelot wrote:
Fri Oct 14, 2022 6:24 pm
An example of barebones input screen:

Code: Select all

default character_name = "John Doe"

screen name_input():
    modal True
    frame:
        align (0.5, 0.5)
        padding (25, 25)
        input value VariableInputValue("character_name", returnable=True)

screen some_screen():
    textbutton "Change Name" action [SetVariable("character_name", ""), ShowTransient("name_input")]


label start:
    "At this moment your name is [character_name]"
    show screen some_screen
    "Try to change it now. Proceed when you do."
    "At this moment your name is [character_name]"
    return
In addition, a working example of input screen, the one which is used by renpy.input by default if no other screen is specified when called, is input screen and it is in screens.rpy of every new project.
Oh, my God! I love you. You saved me. I've seen a lot of different examples, but never the one you gave me. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]