Keeping text box on screen during transitions and toggling between say screens

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Keeping text box on screen during transitions and toggling between say screens

#1 Post by Kinmoku »

Hi all,

This is a little complicated as I'm doing many things at once, but please bear with me...

I have an animated text box for most of my game. As this can sometimes be annoying, I also have the default one which I use when the same character continues talking. In my game, the characters' dialogue boxes are in different locations on the screen, so the animation works well going between characters as it catches the eye, but unfortunately, it runs into issues...

Firstly, here's my code in screens.rpy:

Code: Select all

screen say(who, what):
    style_prefix "say"

    if (sayscreen_label is not None):
        window at say_window_animation:
            id "window"

            if who is not None:

                window:
                    id "namebox"
                    style "namebox"
                    text who id "who"

            text what id "what" at text_fade_in
            
    else:
        window:
            id "window"

            if who is not None:

                window:
                    id "namebox"
                    style "namebox"
                    text who id "who"

            text what id "what"
This is what the animation is doing:

Code: Select all

transform say_window_animation:
    crop_relative True
    alpha 0 crop (0,0, 0.0, 1.0)
    linear 0.15 crop (0,0, 0.3, 1.0)
    linear 0.25 alpha 1.0 crop(0,0, 1.0, 1.0 )

transform text_fade_in:
    alpha 0
    linear 1 alpha 1
In script.rpy, I have:

Code: Select all

default sayscreen_label = None
..and I use "$ sayscreen_label = "on"" and "$ sayscreen_label = None" when I want to switch the animation on and off. It works, but when a character sprite is changing at the same time, the text box disappears and reappears. Trying "window show" doesn't seem to help.

Code: Select all

    show katie_fall fun
    with dissolve
    
    k "First character is talking..." (window_style="window_tall_s1_fall") # same character, same dialogue box

    $ sayscreen_label = None
    
    window show # doesn't appear to work
    hide katie_fall fun
    with dissolve
    
    k "... and is still talking." (window_style="window_tall_s1_fall") # same character, same dialogue box
    
    $ sayscreen_label = "on"
    
    show katie_fall close
    with dissolve
    
    m "Now, the other character is talking." (window_style="window_wide_bottom_middle") # different character, different dialogue box
So, the middle string displays as it's suppose to (with no animation), but the window disappears after the first string, plays the character transition, then shows the second string.

--------------------------------------------------------------------

Another issue I have is when I use pauses in strings, like "{w=1}". The say screen animation repeats when there's a pause unless I switch it off with "$ sayscreen_label = None", but I only want to use this for when the same character is talking. I'd like the initial animation to still show, but not have it repeat whenever there's a pause. Is there a way to do a pause that doesn't break this?

Thanks for any help!

FYI, I'm using this format for strings "(window_style="window_tall_s1_fall")" instead of defining characters as I'm doing a comic book-style VN and the dialogue boxes move around a LOT!
Last edited by Kinmoku on Tue Oct 23, 2018 8:23 am, edited 2 times in total.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Keeping text box on screen during transitions and toggling between say screens

#2 Post by Kinmoku »

Bump.

Does anyone have any ideas? I've edited the original post to make it a little clearer to understand.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Keeping text box on screen during transitions and toggling between say screens

#3 Post by IrinaLazareva »

Kinmoku wrote: Fri Aug 24, 2018 9:10 am It works, but when a character sprite is changing at the same time, the text box disappears and reappears. Trying "window show" doesn't seem to help.
Perhaps, it is the result of "imposing" (the conflict between) of transition and transfrom.
Try to replace dissolve transition to transform.
Instead of:

Code: Select all

    $ sayscreen_label = "on"
    show katie_fall close         <<<<  
    with dissolve                     <<<<
    m "Now, the other character is talking." (window_style="window_wide_bottom_middle") # different character, different dialogue box
to something like this

Code: Select all

    $ sayscreen_label = "on"
    show katie_fall at mydissolve
    
    m "Now, the other character is talking." (window_style="window_wide_bottom_middle") # different character, different dialogue box
Where:

Code: Select all

transform mydissolve(x=.5, y=1.0, t=1):
    align(x,y)
    alpha .0
    ease t alpha 1.0
On the second question I can't help. Probably, will need to create some condition (?) of elimination of tags in the say's screen.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Keeping text box on screen during transitions and toggling between say screens

#4 Post by Kinmoku »

IrinaLazareva wrote: Wed Oct 24, 2018 2:33 pm
Kinmoku wrote: Fri Aug 24, 2018 9:10 am It works, but when a character sprite is changing at the same time, the text box disappears and reappears. Trying "window show" doesn't seem to help.
Perhaps, it is the result of "imposing" (the conflict between) of transition and transfrom.
Try to replace dissolve transition to transform.
Thanks. I'll try this and see if it works.
IrinaLazareva wrote: Wed Oct 24, 2018 2:33 pm On the second question I can't help. Probably, will need to create some condition (?) of elimination of tags in the say's screen.
This gives me a good idea of where to start, though. I'll see if I can figure anything out :)

Post Reply

Who is online

Users browsing this forum: No registered users