[HELP]How to use the customized 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
Charts
Newbie
Posts: 9
Joined: Sun Jan 01, 2017 10:37 pm
Contact:

[HELP]How to use the customized screen?

#1 Post by Charts »

Thanks for ready.
I defined a customized screen,
——————————————————————————
screen battle(what,how):
style_prefix "battle"

window:
id "window"

if what is not None:

window:
style "namebox"
text what id "what"

text how id "what"
———————————————————————————


and I tried to invoke the screen, but error appeared :

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/battle.rpy", line 20: expected a keyword argument or child statement.
    "111111。"
    ^

Ren'Py Version: Ren'Py 6.99.12.2.2029
here's what I write in the script:
_____________________________________________________
screen battle:
"111111"
jump back01
_____________________________________________________


So, how should I use the SCREEN ?
I tried to change the "battle" to the "say",like:

screen say:
"11111"


I still have the same problem....

Does anyone had the same situation once?

Charts
Newbie
Posts: 9
Joined: Sun Jan 01, 2017 10:37 pm
Contact:

Re: [HELP]How to use the customized screen?

#2 Post by Charts »

So, the right way to invoke the screen is :
________________________________________
hide screen say
show screen battle
lj "111111"

hide screen battle
show scren say
jump back01
________________________________

But new problems occured:
"
While running game code:
File "game/battle.rpy", line 21, in script
lj "111111"
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Required parameter what has no value.
"

I must have missed something...

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

Re: [HELP]How to use the customized screen?

#3 Post by Ocelot »

lj "111111" will show screen 'say' and try to pass some parameters to it. This will lead to two screens with displayables with same id be displayed simultaneously. And this is not allowed. Also say screen parameters are called 'who' and 'what'.

What exactly are you trying to achieve? If you want character to use another screen for talking, you can use screen argument, when creating character. https://www.renpy.org/doc/html/dialogue.html#Character
< < insert Rick Cook quote here > >

Charts
Newbie
Posts: 9
Joined: Sun Jan 01, 2017 10:37 pm
Contact:

Re: [HELP]How to use the customized screen?

#4 Post by Charts »

THX, after studied this, your opinion is like down below?
###
define lj = Character(("lily joe"), color="#000000",screen="battle")
###

I tried this ,yes, there's no more error.

However, if I try to open the battle screen, like a RPG game , the whole layout is changed,
I doubt that by creating character is not working, not efficient at least.

So,I changed the screen code,

Code: Select all

screen battle(who, what):
    style_prefix "battle"

    window:
        id "window"

        if who is not None:

            window:
                style "namebox"
                text who id "who"

                text what id "what"
and writing this in script

Code: Select all

    call screen battle
    return
I still get the error message"Required parameter who has no value"

So, should I focus on the way of HOW TO PASSING THE PARAMETER TO "WHO"?
Ocelot wrote:lj "111111" will show screen 'say' and try to pass some parameters to it. This will lead to two screens with displayables with same id be displayed simultaneously. And this is not allowed. Also say screen parameters are called 'who' and 'what'.

What exactly are you trying to achieve? If you want character to use another screen for talking, you can use screen argument, when creating character. https://www.renpy.org/doc/html/dialogue.html#Character

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Andredron, Bing [Bot]