Page 1 of 1

How to Update Outdated Shake Effect

Posted: Tue Apr 09, 2024 9:46 pm
by LuckyJack020
My game used to use the Shake Effect in the outdated Ren'Py cookbook (found here https://www.renpy.org/wiki/renpy/doc/co ... ake_effect ) and with the new updates with the new Position type variable, is it at all possible to receive some help with updating this Effect's code to where I would not need to include the "define config.mixed_position = False" line typically required for fixing this?

It seems to be tied to trying to use xpos and ypos (now the new Position variable) in a math calculation when it's expecting an integer for this portion of the code

nx = xpos + (1.0-t) * self.dist * (renpy.random.random()*2-1)
ny = ypos + (1.0-t) * self.dist * (renpy.random.random()*2-1)

Re: How to Update Outdated Shake Effect

Posted: Thu Apr 11, 2024 3:10 pm
by Andredron

Code: Select all

transform shake2(rate=0.090):
        linear rate xoffset 2 yoffset 0
        linear rate xoffset -2.8 yoffset 2
        linear rate xoffset 2.8 yoffset 0
        linear rate xoffset -2 yoffset 2
        linear rate xoffset +0 yoffset +0
        repeat

transform shake3(rate=0.090):
        linear rate xoffset 2
        linear rate xoffset -2.8
        linear rate xoffset 2.8
        linear rate xoffset -2
        linear rate xoffset +0
        repeat
https://renpymemo.hateblo.jp/entry/2022/02/06/000000