[SOLVED]Syncronicity shake fx issue

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
Calamarcia
Newbie
Posts: 15
Joined: Sun May 06, 2018 10:48 am
Projects: Murder Files: One more shot of whiskey
Contact:

[SOLVED]Syncronicity shake fx issue

#1 Post by Calamarcia »

Hi! :D
Yesterday I implemented a car scene with a tremble effect I found to create a movement illusion.

The fx code I found was the following:

Code: Select all

init:
    transform my_shake:
        linear 0.1 xoffset -3 yoffset 3
        linear 0.1 xoffset 4 yoffset -4
        linear 0.1 xoffset 2 yoffset -2
        linear 0.1 xoffset -3 yoffset 3
        linear 0.1 xoffset 0 yoffset 0
        repeat
And my scene code looks like this:

Code: Select all

label capitulo2:

    scene black with Dissolve(4.0)
    play music "music_sad.ogg" fadeout 1.0 fadein 8.0
    play audio "audio_rain.ogg"
    scene bg_policestation at my_shake
    show victoria worried car at my_shake
    show reilly  normalcar at my_shake
    show parabrisas at my_shake
    show rain

    md "{i}Y aquí estoy, en la puerta de la comisaría esperando a Victoria bajo la lluvia. Dios...debería estar cenando con Charlenne.{/i}"
    md "{i}¿Es que Dios me odia?{/i}"
Here's the video, of this code working:

Since I charged everything more or less at the same time, the shake fx has the same timing for everything and it looks fine.

The problem is when I add a new expression, let's say:

Code: Select all

    md "{i}Y aquí estoy, en la puerta de la comisaría esperando a Victoria bajo la lluvia. Dios...debería estar cenando con Charlenne.{/i}"
    show reilly madcar at my_shake
    md "{i}¿Es que Dios me odia?{/i}"
The my shake fx starts to read from the beggining and may differ from the timeline of the previously charged. This makes my character head move weirdly.

The horrible solution I found is initialization all the scene elements each time I change the expression, which is not very elegant and even may cause performance issues (I really don't know) :cry:

Code: Select all

md "{i}Y aquí estoy, en la puerta de la comisaría esperando a Victoria bajo la lluvia. Dios...debería estar cenando con Charlenne.{/i}"
    scene bg_policestation at my_shake
    show victoria worried car at my_shake
    show reilly madcar at my_shake
    show parabrisas at my_shake
    show rain
    md "{i}¿Es que Dios me odia?{/i}"
    md "{i}Pero da igual...Algo en mi me i
:| :| :|
Do you have any idea to solve this??
Last edited by Calamarcia on Wed Aug 15, 2018 5:41 am, edited 1 time in total.
Image

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Syncronicity shake fx issue

#2 Post by MaydohMaydoh »

Try removing the at my_shake from show reilly madcar.
I don't think you need to supply the transform again if you're just changing the image.

User avatar
Calamarcia
Newbie
Posts: 15
Joined: Sun May 06, 2018 10:48 am
Projects: Murder Files: One more shot of whiskey
Contact:

Re: Syncronicity shake fx issue

#3 Post by Calamarcia »

MaydohMaydoh wrote: Sat Aug 11, 2018 8:06 am Try removing the at my_shake from show reilly madcar.
I don't think you need to supply the transform again if you're just changing the image.
Hi! Thank you for your response :) I already have tried this, though... and unfortunatelly it looks like this


shake it shake it LOL

Anyway thankyou again for your time!
Image

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

Re: Syncronicity shake fx issue

#4 Post by Kia »

maybe you can define a transition instead of of transform and see if a transition could loop, not sure about it.
another idea is putting the images inside a screen and shake the screen, you need to change the facial expressions using variables though

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Syncronicity shake fx issue

#5 Post by Imperf3kt »

I think you can use either a condition switch, or use "show as", which should simply replace an already shown image, with another.
I haven't used condition switches, so I'd go with the show x as x method.

Code: Select all

# for example
    show reilly at my_shake
    "This car ride is so bumpy! I'm getting angry."
    show reilly madcar as reilly
    "You wouldn't like me when I'm... upset."
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Calamarcia
Newbie
Posts: 15
Joined: Sun May 06, 2018 10:48 am
Projects: Murder Files: One more shot of whiskey
Contact:

Re: Syncronicity shake fx issue

#6 Post by Calamarcia »

Imperf3kt wrote: Tue Aug 14, 2018 6:46 pm I think you can use either a condition switch, or use "show as", which should simply replace an already shown image, with another.
I haven't used condition switches, so I'd go with the show x as x method.

Code: Select all

# for example
    show reilly at my_shake
    "This car ride is so bumpy! I'm getting angry."
    show reilly madcar as reilly
    "You wouldn't like me when I'm... upset."
Thank you for your response! I tried to show as... but it's not inheriting the timing :/
Last edited by Calamarcia on Wed Aug 15, 2018 5:54 am, edited 1 time in total.
Image

User avatar
Calamarcia
Newbie
Posts: 15
Joined: Sun May 06, 2018 10:48 am
Projects: Murder Files: One more shot of whiskey
Contact:

Re: Syncronicity shake fx issue

#7 Post by Calamarcia »

Thank you everyone for your responses! :oops:
At the end I couldn't make it work, so I used my *not very orthodox* method lol I checked the cpu and memory and it seems the performance is ok :)



How it looks
Image

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

Re: [SOLVED]Syncronicity shake fx issue

#8 Post by philat »

Bit late to the party, I guess, but try renpy.layer_at_list(). If you don't want the rain (or any other displayable) to shake, you can put it on a custom layer. (See further: https://www.renpy.org/doc/html/displayi ... html#layer )

Code: Select all

label start:
    scene bg_policestation
    show victoria worried car
    show reilly  normalcar
    show parabrisas
    show rain
    $ renpy.layer_at_list(my_shake, "master") # applies my_shake to master layer, which is where all displayables shown with scene or show statements are
    "blah blah"
    $ renpy.layer_at_list([], "master") # stops shaking (the [] is an empty list)
    "Not shaking."

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot]