Animation gradual speeding

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
dasauto1
Regular
Posts: 38
Joined: Sun Oct 31, 2021 2:26 pm
Contact:

Animation gradual speeding

#1 Post by dasauto1 »

Hello, I have an animation that I define it like this:

Code: Select all

image animation:
    "images/dir/im_1.jpg" with dissolve
    0.04
    "images/dir/im_2.jpg" with dissolve
    0.04
    ....
    repeat
and I call it in label using "scene animation with dissolve". This animation runs in the label while there's a dialogue that goes over it that is a bit lengthy.

My question is, how do I change the speed (in this case, 0.04) in the animation so it goes faster or slower gradually as the user walks through the dialogue? So like when the user begins the dialogue it's something like 0.04 and when they're done it's 0.02.

Thanks!

User avatar
YossarianIII
Veteran
Posts: 382
Joined: Tue Jan 13, 2015 10:26 pm
Completed: Guns & Lovers; SRRT!; Kill Your Refrigerator; Banality Man; Beretta Mondatta
Projects: Solidarity Forever
Organization: KONOL Games
Contact:

Re: Animation gradual speeding

#2 Post by YossarianIII »

Do you want it to slow based on time passed or based on the player's position in the dialogue?

If the dialogue is in multiple lines, you could just define multiple, increasingly fast versions of the animation (i.e., "animation normal", "animation fast", "animation faster", "animation fastest") and just Show each one at any place between lines where you want it to speed up. If the dialogue is all one big line, you could still do the same thing, just using "extend" to break the dialogue up. It's not going to give you a completely linear transition, but it'll convey the basic effect.

If you do want a completely smooth ramping up of speed, I don't know exactly what the code would look like, but you might be able to do something with Screen Language and a timer. A lot of time-related things tend to be done with screens.

Image Image

dasauto1
Regular
Posts: 38
Joined: Sun Oct 31, 2021 2:26 pm
Contact:

Re: Animation gradual speeding

#3 Post by dasauto1 »

YossarianIII wrote: Sun Jan 23, 2022 2:36 am Do you want it to slow based on time passed or based on the player's position in the dialogue?

If the dialogue is in multiple lines, you could just define multiple, increasingly fast versions of the animation (i.e., "animation normal", "animation fast", "animation faster", "animation fastest") and just Show each one at any place between lines where you want it to speed up. If the dialogue is all one big line, you could still do the same thing, just using "extend" to break the dialogue up. It's not going to give you a completely linear transition, but it'll convey the basic effect.

If you do want a completely smooth ramping up of speed, I don't know exactly what the code would look like, but you might be able to do something with Screen Language and a timer. A lot of time-related things tend to be done with screens.
Thanks for the reply, but yea, I kinda need it to to be smooth. I tried setting up different definitions but I don't like the looks of it. thanks foe the tip, I might look into it

Post Reply

Who is online

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