Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.4.6] Transform: on show non-functional #2860

Closed
hasnogame opened this issue Jun 18, 2021 · 2 comments
Closed

[7.4.6] Transform: on show non-functional #2860

hasnogame opened this issue Jun 18, 2021 · 2 comments

Comments

@hasnogame
Copy link

Recently updated from an older version of Ren'Py to a newer build and found that on show: transform blocks were no longer functional.

To recreate the issue, create a new project and add this code:

define e = Character("Eileen")

transform basicfade:
    on show:
        alpha 0.0
        linear 1.0 alpha 1.0
    on hide:
        linear 1.0 alpha 0.0

label start:

    scene bg room

    show eileen happy at basicfade

This code results in a failure to display eileen, as seen here:

Image of failed code

If I run the exact same project in 7.4.5, the code works fine.

Image of successful code

Footnotes:

  • The issue is still present when using a fresh install of the 7.4.6 SDK
  • "on hide:" functions properly, completing the transform as expected (e.g. fading the character out using the above code)
  • This issue affects character and image displayables
@AndriWilford
Copy link
Contributor

AndriWilford commented Jun 19, 2021

This appears to be a result of
db30a5a

There's alot of context I don't understand, but perhaps the following word work, or may give an idea..

  1. Revert the above commit
    Later.. EXCEPT the removal of the 'self.execute(self, self.st, self.at)' line.. oops. That should remain gone, I believe.

  2. At:

fr = self.execute(self, self.st, self.at)
# Order a redraw, if necessary.
if fr is not None:
renpy.display.render.redraw(self, fr)
self.active = True

Change to:

    if not (self.at == 0 and self.transform_event == "replace" and self.atl.animation):
        fr = self.execute(self, self.st, self.at)

        # Order a redraw, if necessary.
        if fr is not None:
            renpy.display.render.redraw(self, fr)

    self.active = True

The idea is that, if the atl block is an 'animation' block (so timebase will be at), and if the action is a 'replace' and the "at" timebase is currently 0, then this is a 'replace' of an already-showing displayable with an "animation" atl block showing. The initial execute is just skipped, and the update is called later, after the old transform data has been copied into the new one..

This does have a possibly unintuitive side-effect:
If one creates two different "animation" atl blocks, then "shows" them consecutively on a displayable with the same tags, then the second showing will continue at the same "at" time, even though the transform is a different transform.
It seems that this was kinda intended already, since the original example this was fixing showed a displayable without a transform applied, then later showed the displayable with an "animation" transform, that then continued at the "at" time the first "show" had accrued...

@renpytom
Copy link
Member

I believe this is fixed in the nightlies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants