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

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
GlitchyReal
Newbie
Posts: 17
Joined: Mon Apr 09, 2018 12:28 am
IRC Nick: GlitchyReal
Deviantart: GlitchyReal
Contact:

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

#1 Post 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!
Last edited by GlitchyReal on Sun Jul 18, 2021 4:26 am, edited 1 time in total.
I'm a writer first, artist second, and a programmer... somewhere else. (I'm learning!)

Check out my work here!
http://www.DeviantArt.com/GlitchyReal

Support my work here!
http://www.Patreon.com/GlitchyReal

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

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

#2 Post by Ocelot »

If you want some directions, RenPy documentation on built-in multidialogue might help:
https://www.renpy.org/doc/html/multiple.html
< < insert Rick Cook quote here > >

User avatar
GlitchyReal
Newbie
Posts: 17
Joined: Mon Apr 09, 2018 12:28 am
IRC Nick: GlitchyReal
Deviantart: GlitchyReal
Contact:

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

#3 Post 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.
I'm a writer first, artist second, and a programmer... somewhere else. (I'm learning!)

Check out my work here!
http://www.DeviantArt.com/GlitchyReal

Support my work here!
http://www.Patreon.com/GlitchyReal

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

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

#4 Post 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
< < insert Rick Cook quote here > >

User avatar
GlitchyReal
Newbie
Posts: 17
Joined: Mon Apr 09, 2018 12:28 am
IRC Nick: GlitchyReal
Deviantart: GlitchyReal
Contact:

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

#5 Post 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.
I'm a writer first, artist second, and a programmer... somewhere else. (I'm learning!)

Check out my work here!
http://www.DeviantArt.com/GlitchyReal

Support my work here!
http://www.Patreon.com/GlitchyReal

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice