[Solved... for now] Problem with ATLs applied to say screen and SideImage

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
Angelo Seraphim
Regular
Posts: 36
Joined: Tue May 21, 2019 8:00 am
Completed: Enamored Risks (NaNoReNo 2020)
Projects: 616 Charagma
Organization: GLSUoA
Deviantart: glsuoa
itch: glsuoa
Location: London, UK
Discord: Angel Seraph#9599
Contact:

[Solved... for now] Problem with ATLs applied to say screen and SideImage

#1 Post by Angelo Seraphim »

Hello all,

I hope everyone is having a great day!

I recently updated my project to the newest version of Ren'Py (8.2.0)
Since using this version I have noticed some changes to the behaviour of ATLs.

In short, the ATLs (transforms) are applied to elements in the say screen and the SideImage. However, every time dialogue is displayed the say screen reruns the animation regardless of whether it is the same character speaking or alternating.

Here's the code I have set up for the SideImage().

Code: Select all

transform side_image_change_transform(old, new):
    animation

    subpixel True
    show_cancels_hide True ## Not sure if this does anything for this

    choice:
        contains:
            old
            yalign 1.0 yanchor 1.0 alpha 1.0
            ease_quad 0.25 yanchor 0.0 alpha 0.0
        contains:
            new
            yalign 1.0 yanchor 0.0 alpha 0.0
            ease_quad 0.25 yanchor 1.0 alpha 1.0

    choice:
        contains:
            old
            yalign 1.0 xanchor 0.0 alpha 1.0
            ease_quad 0.25 xanchor 1.0 alpha 0.0
        contains:
            new
            yalign 1.0 xanchor 1.0 alpha 0.0
            ease_quad 0.25 xanchor 0.0 alpha 1.0

    on hide:
        new
        yalign 1.0 yanchor 1.0 alpha 1.0
        ease_quad 0.25 yanchor 0.0 alpha 0.0

transform side_image_same_transform(old, new):
    animation
    old
    new with Dissolve(0.05, alpha=True, mipmap=False)

define config.side_image_change_transform = side_image_change_transform
define config.side_image_same_transform = side_image_same_transform
And here's the one for the say screen:

Code: Select all

transform say_box_appear(delay=0.0):
    animation  ## I've added this, but I'm unsure if this even does anything for this particular matter.
    
    on show:  ## Each time the screen is updated this part of the animation is executed.
        yoffset 100.0
        easeout 0.15 yoffset 0.0

    on replace, replaced:  ## This does nothing...
        yoffset 0.0
        easeout 0.15 yoffset 15.0
        easein 0.15 yoffset 0.0

    on hide:  ## Each time the screen is updated this part of the animation is executed.
        pause delay
        yoffset 0.0
        easeout 0.2 yoffset 500.0


screen say(who, what):

    style_prefix "say"

    if not renpy.variant("small"):
        add SideImage() align (0.5, 1.0) xpos -240 xanchor 0.0 yoffset 1300.0

    window:
        id "window"
        background Transform("gui/textbox_style_A.png", xalign=0.5)
        at say_box_appear(0.15)

        if who is not None:
            window:
                id "namebox"
                style "namebox"
                
                text who.upper() id "who":
                    xalign 1.0
                    text_align 1.0
                    xanchor 1.0

        text what id "what" outlines [(0, "#000D", 1, 1)]
When dialogue is shown the animation is rerun.
As for the side image, when it's changing characters the 'hide' event is executed resulting in a ghosting effect when the side image changes to another character.

Here's a quick video to demonstrate the issues I'm facing.


I've tried playing around with some variables, but nothing these aren't causing any problems or rectifying the issue.
I can't quite figure out a solution to fix this. I've had other animations in other screens start behaving strangely as well i.e. animation (ATL/transform) constantly being reran.

Just wondering if any one has or is having this same issue and if you have any solutions or pointers. That would be greatly appreciated.

Thank you in advance.
Last edited by Angelo Seraphim on Sun Feb 04, 2024 5:51 pm, edited 2 times in total.
Image

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Problem with ATLs applied to say screen and SideImage

#2 Post by m_from_space »

Angelo Seraphim wrote: Sun Feb 04, 2024 10:44 am Just wondering if any one has or is having this same issue and if you have any solutions or pointers. That would be greatly appreciated.

Thank you in advance.
The say screen is constantly hiding an showing when another character starts speaking. I'm not sure if you can suppress this behavior by stating:

Code: Select all

window show
But then you would have to hide it manually every time nothing is said. Or set it back to window auto show before the end of a scene.

I suggest making the animated background not part of the say screen itself, but another screen that just checks whether the say screen is visible or not.

Code: Select all

screen my_say_background():
    # behind the say screen
    zorder -1
    showif renpy.get_screen("say"):
        add "background" at say_box_appear

label start:
    show screen my_say_background
    "Hey, this should work."
As for the ghost image, the side image is hiding and therefore the hide event is executed and so you have this fade effect you wrote.

Wasn't this happening before the update?

User avatar
Angelo Seraphim
Regular
Posts: 36
Joined: Tue May 21, 2019 8:00 am
Completed: Enamored Risks (NaNoReNo 2020)
Projects: 616 Charagma
Organization: GLSUoA
Deviantart: glsuoa
itch: glsuoa
Location: London, UK
Discord: Angel Seraph#9599
Contact:

Re: Problem with ATLs applied to say screen and SideImage

#3 Post by Angelo Seraphim »

Thank you for the reply.

Yes, I suspect that the say screen is being hidden and shown every time the text changes.

I do have config.window set to "auto", and I've tried setting it to "hide" to see if that changes anything, but got the same results.
I do want to avoid using window hide etc since that's going to be tedious.

As for the SideImage(), not sure why it keeps executing the "hide" event when the character changes. Before it used to just hide the character when they are the last character speaking, but now it executes whenever the character changes regardless if they are last or not.

I'll have a play around with the suggestion you provided.
Wasn't this happening before the update?
No. This wasn't happening, I think, before 8.1.1 -- it was working fine. And I did allow it throughout 8.1.1 since I was working on other things.
I know there have been some changes to ATL and that has affected how they work in general. I have a feeling that it's the behaviour is intended, but that means I'll have to figure out a workaround to achieve the desired animations I had before.
Image

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

Re: Problem with ATLs applied to say screen and SideImage

#4 Post by Kia »

I've noticed a similar behavior in some of my older screens too. Looks like interactions trigger some of the animations that didn't trigger in the old versions, I haven't looked into the issue though.

User avatar
Angelo Seraphim
Regular
Posts: 36
Joined: Tue May 21, 2019 8:00 am
Completed: Enamored Risks (NaNoReNo 2020)
Projects: 616 Charagma
Organization: GLSUoA
Deviantart: glsuoa
itch: glsuoa
Location: London, UK
Discord: Angel Seraph#9599
Contact:

Re: Problem with ATLs applied to say screen and SideImage

#5 Post by Angelo Seraphim »

Update: Your suggestion works.

Here's what I've done:

Code: Select all

screen say_text_box():
    zorder -1
    showif renpy.get_screen("say"):
        if persistent.dialogue_art_boxes:
            add "gui/textbox_shape_1.png":
                yalign 1.0
                yoffset 90.0
                at say_box_appear(0.075)
        
        add SideImage() align (0.5, 1.0) xpos -240 xanchor 0.0 yoffset 1300.0

        frame:
            background Transform("gui/textbox_style_[persistent.dialogue_textbox_style].png", xalign=0.5, yalign=1.0)
            at say_box_appear(0.15)
            
init python:
    config.always_shown_screens.append('say_text_box')
However, for the SideImade transform the "hide" event doesn't execute after the last character has spoken. Other than that everything else works as far as I can see.
Will continue to experiment with this for now.

Thanks for your help.
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot], rag_exe21