[SOLVED] Say window ATL animation replaying on {w} tag

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
hassohappa
Regular
Posts: 33
Joined: Thu Oct 22, 2015 8:51 pm
Tumblr: me-patra
Contact:

[SOLVED] Say window ATL animation replaying on {w} tag

#1 Post by hassohappa » Thu Feb 04, 2016 8:32 pm

I have an ATL transform that causes the say window to ease in from the bottom of the screen when a new character speaks, like this: https://youtu.be/zSml_ZQW30c?t=52s
This works okay, but if I use a wait tag in the dialogue like {w=1.0}, the ATL animation starts again when the text scrolls to the wait tag, so the textbox will ease in from the bottom again partway through the dialogue.

Does anyone know a good way to circumvent this, or just a plain better way to get the same effect?
I'm honestly stumped, so I'm considering just making the dialogue window background clear and manually showing the window background as an image to fake it...

Here's my say screen right now:

Code: Select all

screen say(who, what, side_image=None, two_window=False, who_window_style= "say_who_window"):
        
     if newSpeaker: #if a new character is speaking, do this
        # Decide if we want to use the one-window or two-window variant.
        if not two_window:

            # The one window variant.
            window:
                id "window"
                at winFade #here's the ATL transform
                has vbox:
                    style "say_vbox"

                if who:
                    text who id "who"

                text what id "what"

        else:

            # The two window variant.
             vbox:
                style "say_two_window_vbox"
                at winFade #here's the ATL transform
                window:
                    ypos 347
                    id "window"

                    has vbox:
                        style "say_vbox"

                    text what id "what"
                if who:
                    window:
                        xpos -10
                        ypos -82
                        style "say_who_window"

                        text who:
                            id "who"
    else: #otherwise like normal
        ...
The ATL transform:

Code: Select all

transform winFade:
    on show:
        xalign .5 ypos 860
        alpha 0.0
        easein 0.3 alpha 1.0 ypos 768
        
    on hide:
        easein 0.3 alpha 0.0 ypos 860
Thanks for the help in advance, as always...
Last edited by hassohappa on Fri Feb 05, 2016 6:06 pm, edited 2 times in total.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Say window ATL animation replaying on wait tag in dialog

#2 Post by philat » Fri Feb 05, 2016 12:39 am

How are you determining newSpeaker?

ETA: Basically I was wondering if there would be some way to circumvent the animation playing again based on newSpeaker, but on second, it may be easier to simply use extend.

Code: Select all

e "blah blah blah {w=1.0}{nw}" # the nw tag so that the player isn't required to CTC
$ newSpeaker = False # if you're determining newSpeaker manually. If you're doing it programmatically, it should work automatically, since extend is merely the equivalent of last_speaker "last line{fast} new line"
extend " more blah blah blah"

User avatar
hassohappa
Regular
Posts: 33
Joined: Thu Oct 22, 2015 8:51 pm
Tumblr: me-patra
Contact:

Re: Say window ATL animation replaying on wait tag in dialog

#3 Post by hassohappa » Fri Feb 05, 2016 4:03 am

Thanks for the suggestion to use extend! Unfortunately, while it does prevent the animation from playing again, it causes this flash between the two halves of the line, so I can't quite use it... http://i.imgur.com/xVW3ffW.gifv

I'm determining newSpeaker manually, just like you've put above! What kind of way were you thinking of for circumventing the animation playing again based on newSpeaker?

( I originally tried to check if the previous speaker and current speaker have the same name, but I clearly did it wrong, because the game just went bonkers... )

Code: Select all

screen say(who, what, side_image=None, two_window=False, who_window_style= "say_who_window"):
    
    $newWho=who #idk how to access just the string that's the name. I think it might be id "who", but idk the right syntax to get that into a variable
    if newWho==oldWho:
        if not two_window:
            window:
                id "window"
                at winFade
                has vbox:
                    style "say_vbox"
                if who:
                    text who id "who"
                text what id "what"
        else:
             vbox:
                style "say_two_window_vbox"
                at winFade
                window:
                    id "window"
                    has vbox:
                        style "say_vbox"
                    text what id "what"
                if who:
                    window:
                        style "say_who_window"
                        text who:
                            id "who"
    else: #otherwise like normal
         ...
    $oldWho=who #after the dialogue has already been displayed, set this to check against the next speaker's name

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Say window ATL animation replaying on wait tag in dialog

#4 Post by philat » Fri Feb 05, 2016 10:04 am

Nah, I was asking because I could never be bothered to find a working solution and I was wondering if you had. I know it's possible -- others have talked about it, but the impression I got was that it was a bit of a mess to implement. Reason being screens are run behind the scenes often (for prediction, etc.), so that any code inside the screen inevitably ends up being run at unexpected times. I would assume that a real solution would involve hijacking the say statement, which is just way too in the guts of renpy for my liking.

Anyway, for the flickering problem I was just throwing shit at the wall to see what would stick and stumbled across a solution. The issue is, for whatever reason, the {w} tag itself. I don't pretend to know the inner workings of renpy all that well, but my guess is that {w} itself involves reshowing the screen. Therefore, move the {w} to AFTER newSpeaker has been set to false.

Code: Select all

e "blah blah blah{nw}"
$ newSpeaker = False
extend "{w=1.0} more blah blah blah"
Which is a pain in the butt, but well, it works.

User avatar
hassohappa
Regular
Posts: 33
Joined: Thu Oct 22, 2015 8:51 pm
Tumblr: me-patra
Contact:

Re: Say window ATL animation replaying on wait tag in dialog

#5 Post by hassohappa » Fri Feb 05, 2016 6:03 pm

Knowing that now, it would've been some kind of miracle if by chance I really did get it working! I hope someone does post a solution for it someday.

And holy cow, moving the {w} tag after like that works!! There's a plugin in Notepad++ for multiline find/replace, so I was able to replace all my wait tags with that in about 10 seconds.

Thanks so much again, you're a real life saver!! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], span4ev