Ren'Py multiple_say [SOLVED]

_13_

Active Member
Game Developer
Oct 8, 2020
799
2,679
I have a section of my script where I'd like two characters' dialogue to be shown at the same time. So, I do some searching and find which shows that it can be done, simply. Great! However, both dialogues are shown on top of each other. Not great!

Well, further down that page it talks about styles and windows and screens, but it doesn't say how to use them. It says that block2_multiple2_say_window is the window of the second dialogue block and it can be displayed on the right side with x align 1.0. It doesn't show an example of that, nor say how to use xalign.

A search of Ren'Py's documentation, like many other functions, gives a list of functions, including xalign, with a description, but not an explanation of how to use it. So, I think I have to put "block2_multiple2_say_window (xalign=1.0)" somewhere, but maybe the "xalign=1.0" goes on a line below "block2_multiple2_say_window " or maybe it all goes next to the dialogue? I've tried many ways to try getting it to work. Some keep the game from starting and some bring an error when the game get's to that point, but nothing is working. One thing I did, didn't return an error, but also didn't change they way the dialogues were displayed.

Could someone please help me with this? Maybe it goes in the options.rpy file and then I have to refer to it? I don't know.
 

MrSilverLust

MSL Games
Game Developer
May 22, 2021
453
3,019
Interesting, I didn’t know you could do that.

Just as is mentioned in the documentation, you need to use styles to make the dialogue boxes as you like and not over each other. I tried this really quickly and it worked.

Code:
define e = Character("Eileen")
define l = Character("Other Character")

style multiple2_say_window:
    xsize 500
    background None

style block1_multiple2_say_window:
    xalign 0.0

style block2_multiple2_say_window:
    xalign 0.5

label start:
    e "Single dialog."
    e "Ren'Py supports displaying multiple lines of dialogue simultaneously." (multiple=2)
    l "About bloody time! I've been waiting for this for years." (multiple=2)
    return
Try it and adjust it to your liking.
 
Last edited:
  • Like
Reactions: Trope95 and _13_

AnimeKing314

Giant Perv
Game Developer
Jun 28, 2018
395
597
Adding to this (currently playing around with it a bit) I want to have multiple characters say the same thing at the same time. Does anyone know a way to move just the character's name (as in move just the who textbox for the second block)?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,284
Adding to this (currently playing around with it a bit) I want to have multiple characters say the same thing at the same time. Does anyone know a way to move just the character's name (as in move just the who textbox for the second block)?
If I understood correctly what you want, you don't need to change anything, except the way the dialog line will be wrote. You can have anonymous sayers, therefore just put the names together and it will do the trick.

Code:
label whatever:
    "girl1 & girl2" "Hey, glad to see you."
 

AnimeKing314

Giant Perv
Game Developer
Jun 28, 2018
395
597
If I understood correctly what you want, you don't need to change anything, except the way the dialog line will be wrote. You can have anonymous sayers, therefore just put the names together and it will do the trick.

Code:
label whatever:
    "girl1 & girl2" "Hey, glad to see you."
Yes, I ended up doing that but using the actual character like this:
Python:
define a = Character("John", color="#050505")
define b = Character("Sister", color="#505050")

label start:
    "[a] & [b]" "Hello"
    return
The only part I'm struggling with now is getting the color of the character. Something along the lines of:
Python:
"{color=a.color}[a]{/color} & {color=b.color}[b]{/color}" "Hello"
but I can't find a way to access the color attribute of the character like this (if you know a quick solution then great if not I'll keep playing around and make a new thread about it if I have to).
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,284
but I can't find a way to access the color attribute of the character like this (if you know a quick solution then great if not I'll keep playing around and make a new thread about it if I have to).
It's one of the arguments for the "who" part, therefore it should be on the who_args dictionary of the character. This should works:
Code:
"{color=a.who_args["color"]}[a]{/color} & {color=b.who_args["color"]}[b]{/color}" "Hello"
 

AnimeKing314

Giant Perv
Game Developer
Jun 28, 2018
395
597
It's one of the arguments for the "who" part, therefore it should be on the who_args dictionary of the character. This should works:
Code:
"{color=a.who_args["color"]}[a]{/color} & {color=b.who_args["color"]}[b]{/color}" "Hello"
With a slight modification this worked but then someone else pointed out a different way that results in cleaner code where basically you define the character as define a = Character({color=#050505}John{/color}. Thank you for the help though.
 

Rycharde's Realm

Well-Known Member
Game Developer
Jan 17, 2018
1,092
724
I know this is an ancient post but I would like to find out what *.rpy file to insert the code below: gui.rpy, options.rpy, etcetera. I suffer from OCD. ;)

Python:
style multiple2_say_window:
    xsize 500
    background None

style block1_multiple2_say_window:
    xalign 0.0

style block2_multiple2_say_window:
    xalign 0.5
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,284
I know this is an ancient post but I would like to find out what *.rpy file to insert the code below: gui.rpy, options.rpy, etcetera.
Whatever one you want. Ren'Py don't care in what file the code is, as long as it's in the "game" directory, or a sub folder of it, and the extension is "rpy".
The only constraint is that the files will be proceeded by alphabetical order. Therefore don't do something like:
a.rpy:
Code:
init python:

    anabella = GirlStats( "Anabella" )
b.rpy:
Code:
init python:
    class GirlStats( [...] )

I suffer from OCD. ;)
all the more reason to decided yourself in what file to put it.
 
  • Like
Reactions: Rycharde's Realm