How to make two characters speaking at the same time?

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
Near
Newbie
Posts: 12
Joined: Wed Aug 08, 2012 10:57 am
Contact:

How to make two characters speaking at the same time?

#1 Post by Near »

Hello! I have a question: how to make two characters speak at the same time in separate textboxes?
Here's what I mean: (mad painting skillz, I know :D)
Image

User avatar
Chasing Summer
Regular
Posts: 95
Joined: Thu Jan 09, 2014 12:12 pm
Projects: unannounced project
Location: Sweden
Contact:

Re: How to make two characters speaking at the same time?

#2 Post by Chasing Summer »

Well.. I’m not sure I can be much help. I do know what you could do if you want two characters to speak at the same time and saying the same thing. Judging what you drew with your awesome skillz, I don’t think that’s what you meant. Good luck!
new account: sonnenblumen

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: How to make two characters speaking at the same time?

#3 Post by nyaatrap »

There is a code for it, but not sure ren'py will have it in default. (https://github.com/renpy/renpy/pull/144)

I wrote a code to do simpler, but not flexible way in the past at http://lemmasoft.renai.us/forums/viewto ... 81#p249581

User avatar
Near
Newbie
Posts: 12
Joined: Wed Aug 08, 2012 10:57 am
Contact:

Re: How to make two characters speaking at the same time?

#4 Post by Near »

Ummm, nyaatrap, I apologize for being such newbie, but I have a problem with using your code. I should paste it into script.rpy right? When I did it, and tried my characters to use it (g|m "I knew it!|Yikes!" that's what I tried to do), there appears error.
Image

Thanks for help ^^.

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: How to make two characters speaking at the same time?

#5 Post by Asceai »

I suspect you need:

Code: Select all

"g|m" "I knew it!|Yikes!"
with both parts quoted

User avatar
Near
Newbie
Posts: 12
Joined: Wed Aug 08, 2012 10:57 am
Contact:

Re: How to make two characters speaking at the same time?

#6 Post by Near »

Unfortunately, this didn't work. When I did what you said Asceai, this has appeared.
Image

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: How to make two characters speaking at the same time?

#7 Post by Asceai »

You need to edit the say code in screens.rpy and hack in nyaatrap's code. In testing it I replaced the 'twowindow' bit of code with it. What you want is for the normal code to be called if there's no | found in the string.

e.g.

Code: Select all

screen say:
    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    if not what.find("|") == -1:
        window:
            area (32,536,512,200)
            id "window"

            if who:
                text who.split("|")[0] id "who" ypos -0.2

            text what.split("|")[0] id "what"
           
        window:
            area (640,536,512,200)
            id "window"

            if who:
                text who.split("|")[1] id "who" ypos -0.2

            text what.split("|")[1] id "what"
    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu
like nyaatrap said, it requires screen coding to customise. For example, the hardcoded positions require quite a large screen width and height to work properly, so you'd either want to adjust those positions or make your screen bigger.

Post Reply

Who is online

Users browsing this forum: Tomoyo Ichijouji