Page 1 of 1

[SOLVED] Two (2) Dialogue Boxes? (Hotel Dusk-like)

Posted: Tue Jul 13, 2021 5:28 am
by GlitchyReal
My favorite visual novel is still Hotel Dusk: Room 215. I was a bit dismayed ever since the Switch went back to single-screen to ever have something like this again, but-- hey! Why not emulate the style as best we can instead?

Image

This is ultimately what I'm trying to make two separate screens or dialogue boxes for two separate characters as seen in this mock up below (made in After Effects, not Ren'Py). Yes, it looks awful, but that's okay right now.
Image

Dialogue Box 1 (left) and Dialogue Box 2 (right) need to be on-screen at the same time with the inactive box dimming (or disappearing, but I prefer dimming) while the active box scrolls. I'd also like each box to be toggled on/off when needed in case there is only one character in the scene. Also would be excellent to have an "internal style" such as the above's example of Kyle's "This kid's a loon."

I also intended for scenes with more than two characters to use opposing boxes relating to their spatial position or reflective of their relationship with other characters in the scene so the boxes can't be locked to one character unless I'm also able to repeat the style over several characters.

Can anyone help me even get started? I'm very much a novice, but I do understand the fundamental basics and know how to utilize a guide or tutorial. But I'm looking for more specific advanced-level stuff and thought I'd finally try asking for help here.

Any help would be appreciated!

Thank you!

Re: [HELP] Two (2) Dialogue Boxes? (Hotel Dusk-like)

Posted: Tue Jul 13, 2021 5:44 am
by Ocelot
If you want some directions, RenPy documentation on built-in multidialogue might help:
https://www.renpy.org/doc/html/multiple.html

Re: [HELP] Two (2) Dialogue Boxes? (Hotel Dusk-like)

Posted: Tue Jul 13, 2021 5:47 am
by GlitchyReal
Thank you for the quick response, Ocelot!

I've been looking this over for a bit already. I've only yet been able to get the dialogue boxes to appear simultaneously-- as in overlapping and interrupting each other. I'm not sure how to force them to wait their turn.

Re: [HELP] Two (2) Dialogue Boxes? (Hotel Dusk-like)

Posted: Tue Jul 13, 2021 7:53 am
by Ocelot
I cobbled something quickly to show possbilities. First of all, to be able to figure out, who is speaking and style active character, I changes the say screen in screens.rpy the following:

Code: Select all

screen say(who, what, active=True):
    style_prefix "say"
    window:
        id "window"

        if who is not None:
            window:
                id "namebox"
                style "namebox"
                if active:
                    text who id "who"
                else:
                    text who id "who" color "#555"
        text what id "what"
This will color name of inactive character gray.
Next I created new styles to move multiple dialogue windows apart:

Code: Select all

style multiple2_say_window is say_window:
    xsize 600

style block1_multiple2_say_window is multiple2_say_window:
    xalign -0.3

style block2_multiple2_say_window is multiple2_say_window:
    xalign 0.7
This looks crappy and you should not be using default style to display multiple characters, but this is demonstration.

Then I created my script:

Code: Select all

define n = Character("Narrator")
define e = Character("Eileen")

label start:

    e "Ren'Py supports displaying multiple lines of dialogue simultaneously." (multiple=2)
    n "" (multiple=2, show_active=False)

    e "" (multiple=2, show_active=False)
    n "You can make lines of non-speaking character diappear." (multiple=2)

    e "Now narrator lines remain on screen even if he is not one who talks." (multiple=2)
    n "You can make lines of non-speaking character diappear.{fast}" (multiple=2, show_active=False)

    e "And we can talk together!." (multiple=2)
    n "And we can talk together!." (multiple=2)

    return
Notice that you are alway provide text for both screens at the same time. Additionally, I pass 'active' argument, which I defined earlier, to say screen, so inactive character name would be grayed out.
https://i.imgur.com/fDJ8tqW.png

Re: [HELP] Two (2) Dialogue Boxes? (Hotel Dusk-like)

Posted: Thu Jul 15, 2021 5:51 am
by GlitchyReal
Ocelot wrote:
Tue Jul 13, 2021 7:53 am
I cobbled something quickly to show possbilities. First of all, to be able to figure out, who is speaking and style active character, I changes the say screen in screens.rpy the following:
Wow, awesome, thank you for this! I should be able to work something out with your example code.

Let's see how this turns out!

_______

EDIT: It worked! Thank you! This has really helped me understand how screens and styles work, especially the say_screen. Issue resolved!

But if I still have your attention, I'm trying to also call the (multiple=2) and (multiple=2, show_active=False) faster with something like a callback. I've been able to do this with voice blips, but not sure how to apply this to the above functions.

No big if no reply, I just gotta dig deeper.