Starting an animation from where the previous one stopped

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
skwada
Newbie
Posts: 2
Joined: Mon Feb 12, 2024 2:23 pm
Contact:

Starting an animation from where the previous one stopped

#1 Post by skwada »

Hi i have 2 looped animations of a character standing and breathing that are exactly the same except for the facial expression, both are 4 seconds long. I'd like to make it so if the current animation is on frame 30 when the user clicks to the next dialogue, then the next animation will pick up from frame 31. I was trying to accomplish this with:

Code: Select all

    image breathing 1:
        animation
        "wakeup 1"
        pause 4.0
        repeat

    image breathing 2:
        animation
        "wakeup 5"
        pause 4.0
        repeat
and

Code: Select all

scene breathing 1
""
scene breathing 2
 
but the second animation starts from frame 0 when i click forward, I think because the "wakeup 5" statement in "breathing 2" doesn't start playing until we enter "breathing 2". I am wondering if there is any other way to accomplish this? And just to be sure, the way I defined these atl blocks, breathing 1 and breathing 2 would be on the same animation timebase right? Because if not, then fixing that might get it working.

P.s. the animations themselves are defined like so: `Movie(fps=60, play=webmPath, start_image=firstFramePath, keep_last_frame=True, loop=True, group="wakeup")`

Also I think one way of doing this might be to manually define the animations frame-by-frame with ATL but that is problematic because all in all its about a minute worth of 60fps 4K animation, so storing the individual frames takes up like 40-60gb while storing the compiled animation file is about 100mb

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

Re: Starting an animation from where the previous one stopped

#2 Post by m_from_space »

skwada wrote: Mon Feb 12, 2024 2:39 pm Hi i have 2 looped animations of a character standing and breathing that are exactly the same except for the facial expression, both are 4 seconds long. I'd like to make it so if the current animation is on frame 30 when the user clicks to the next dialogue, then the next animation will pick up from frame 31.
I think you could just start both "animations" (I mean we're actually talking video here) and make one of them invisible (or draw it behind the other one). And when the user clicks, just remove the front animation. You could even use a dissolve effect for smoothness.

skwada
Newbie
Posts: 2
Joined: Mon Feb 12, 2024 2:23 pm
Contact:

Re: Starting an animation from where the previous one stopped

#3 Post by skwada »

Thanks

Post Reply

Who is online

Users browsing this forum: Google [Bot]