Custom "Say" 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
anniecat
Newbie
Posts: 3
Joined: Wed Sep 02, 2015 12:03 pm
Contact:

Custom "Say" Screen

#1 Post by anniecat »

Hey all, I have what is hopefully a fairly simple question, I'm just not making headway on figuring it out. I just want to make a custom version of the "say" screen. I want to have a screen where the dialogue appears in a a faux-instant messenger style format. I created a new screen and customized the view (code below):

Code: Select all

screen messages():
    modal True
    zorder 1
    frame:
        style_group "messages"
        xsize 1050
        ysize 850
        xalign 0.5
        yalign 0.5
        
        has vbox
        xfill True
        hbox:
            null height 10
        
        side "c r":
            area (0, 0, 1040, 800)
            viewport id "read_messages":
                draggable True mousewheel True
                vbox:
                    xfill True
                    xalign 0.5
                    xmaximum 1000
                    
                    label "[messages] Inbox" xalign 0.5
                    
                    label "CharacterA" xalign 0.0
                    text "NEED SCRIPT DIALOGUE HERE" xalign 0.0
                    
                    label "CharacterB" xalign 1.0
                    text "NEED SCRIPT DIALOGUE HERE" xalign 1.0
                    
                vbar value YScrollValue("read_messages"):
                    xalign 1.0
        
        hbox:
            null height 20
            
        textbutton "Return" action Hide("messages") xalign 0.5
        
        hbox:
            null height 20

init -2 python:

    style.messages = Style(style.default)
    
    style.messages_label_text.size = 35
    style.messages_label_text.color = "#FFFFFF"
    
    style.messages_text.color = "#FFFFFF"
    style.messages_text.size = 25
    style.messages_text.xmaximum = 500
I've been trying to pass my script through to the "text" displays in a variable but it's not quite working:

Code: Select all

label messages:
    show screen messages   
    
    CharacterA: "Hey"
    CharacterB: "Yo"
Etc. etc.

At the end of the day, I want to pass in the dialogue (ie: CharacterA "How are you?", CharacterB "Just fine!") and be able to advance the story by clicking "next", the same as the way the nvl and say screens work. I know I'm probably missing something fairly obvious, and I've been all over the help docs, but the solution to this problem is just not clicking. Any help is greatly appreciated! The examples I've been looking at haven't quite been helping since I still want to use the default say and nvl screens, I just want a custom copy to use for these particular sections of the story-telling.

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Custom "Say" Screen

#2 Post by Kia »

is't it easier to define two (or more) characters with custom chat window? you can have those extra parts in the default window and show them only needed with some if command. even the draggable part.
Edit: I recall doing something similiar on my first week working with renpy. you can pass your message to your screen as a variable when calling it.

Code: Select all

screen messages(msg):
    text "[msg]"

Code: Select all

call messages("say something")

anniecat
Newbie
Posts: 3
Joined: Wed Sep 02, 2015 12:03 pm
Contact:

Re: Custom "Say" Screen

#3 Post by anniecat »

Thanks, Kia! I'm going to try this. I'm sure I'm completely overthinking it at this point, just a bit exhausted. Thanks so much for your help!

anniecat
Newbie
Posts: 3
Joined: Wed Sep 02, 2015 12:03 pm
Contact:

Re: Custom "Say" Screen

#4 Post by anniecat »

Hey Kia, I am working with your solution, as well, and I was able to alter this help to get the result I want:

http://lemmasoft.renai.us/forums/viewto ... =8&t=28925

Thanks again, this forum is a godsend!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Ocelot