Reproducing the say screen in another 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
User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Reproducing the say screen in another screen

#1 Post by jack_norton »

Long story short, I am working on a rather complex game, and I need to have a say screen behaving like the regular one, but somehow it doesn't work. I can't simply use renpy.say and other shortcuts, I really need to have a duplicate of the say screen like this:

Code: Select all

screen sayoverlay(who,what):
    key "dismiss" action Hide("sayoverlay")
    zorder 99
    modal True

    style_prefix "say"

    window:
        id "window"

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

        text what id "what"

    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0 zoom .7
However, when I call it, produces result as if there was no style applied (speaker color, font, etc):
Image
I don't understand why! I copied the default say screen, so why isn't working exactly as the original? I suspect the issue is in how I pass the parameters:

Code: Select all

    elif spot.spot_type=="character":
        show screen sayoverlay("Adriana",spot.description)
if in the first parameter (the who) I try to put a Character token it displays an error... :O
Any help would be very appreciated :)
follow me on Image Image Image
computer games

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

Re: Reproducing the say screen in another screen

#2 Post by Ocelot »

jack_norton wrote: Fri Nov 03, 2023 5:28 am I don't understand why! I copied the default say screen, so why isn't working exactly as the original?
Because you didn't go through say statement (or its python equivalent) mechanism, which is responsible for correctly setting up say screen.

I suspect XY-problem there. You think that you need to use show screen with copy of the say screen (why a copy, why not a regular say screen?) here, and so you neglected to mention actual thing you are trying to do.

What are you trying to do, that isn't covered by a non-interactive say statement (possibly with a custom screen)?

Something like:

Code: Select all

elif spot.spot_type=="character":
    Adriana spot.description (interact=False, advance=False, screen=sayoverlay)
# Do not cause an interaction, which means ^     ^           ^ Screen to use instead of "say" screen
# that script will continue executing past       |
# this point                                     | Normal ways of dismissing say screen will not work
#                                                  You need to handle this yourself (like you did with the dismiss keybind)
< < insert Rick Cook quote here > >

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Reproducing the say screen in another screen

#3 Post by jack_norton »

edit: nevermind, spoke with Tom, the best / fastest solution is to just hard-code the styles in the screen :)
follow me on Image Image Image
computer games

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

Re: Reproducing the say screen in another screen

#4 Post by Ocelot »

So, the real issue is in previous screen disappearing, which is not a normal behavior for screens. It might be better to solve that problem instead. Why does it happens? is it transient screen?
< < insert Rick Cook quote here > >

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Reproducing the say screen in another screen

#5 Post by jack_norton »

Nah it's fine I got it to work. It's a bit too complex to explain, in practice the "adventure part" is a screen, but when I get to dialogues is a normal VN. So I would need to keep in the VN all the adventure part stuff, and they're all layers based on which characters or items you can interact with in that location of the game. A bit of a mess haha. But manually customizing that, solved the issue! thanks
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot]