How to make a loopable animation after a particular frame?

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
asatiir
Regular
Posts: 86
Joined: Tue Oct 01, 2013 6:04 pm
Completed: Within the Walls (Twine)
Projects: Roses Will Rise
Organization: Asatiir's Tales
Skype: asatiir
itch: asatiir
Location: Dubai, UAE
Contact:

How to make a loopable animation after a particular frame?

#1 Post by asatiir »

Hi,

There's an animated sprite I made with two separate animations, one that starts the animation and the other loops after. I've had two solutions (neither of which I know how to do and would appreciate the help):

- Make two separate image labels and tell renpy to play one after another (I tried show-pause-hide, but that somehow skipped a few frames.)
- make one label and somehow tell it to repeat between specific frames (which I don't know how)

I don't know an effective way to do either and I'm not sure if there's a better way, would anyone know? thanks.
Image
Image

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to make a loopable animation after a particular fram

#2 Post by Ocelot »

You want a block statement: https://www.renpy.org/doc/html/atl.html#block-statement

something like:

Code: Select all

image animation:
    'frame 1.png'
    0.2
    'frame 2.png'
    block:
        0.2
        'frame 3.png'
        0.2
        'frame 4.png'
        repeat
It will show first two frames and then repeat frames 3 and 4.
< < insert Rick Cook quote here > >

User avatar
asatiir
Regular
Posts: 86
Joined: Tue Oct 01, 2013 6:04 pm
Completed: Within the Walls (Twine)
Projects: Roses Will Rise
Organization: Asatiir's Tales
Skype: asatiir
itch: asatiir
Location: Dubai, UAE
Contact:

Re: How to make a loopable animation after a particular fram

#3 Post by asatiir »

Ocelot wrote:You want a block statement: https://www.renpy.org/doc/html/atl.html#block-statement

something like:

Code: Select all

image animation:
    'frame 1.png'
    0.2
    'frame 2.png'
    block:
        0.2
        'frame 3.png'
        0.2
        'frame 4.png'
        repeat
It will show first two frames and then repeat frames 3 and 4.
This worked! thanks a lot!

edit: okay that solved on problem and brought another, now when I try to move the animation it starts the nimation from the very beginning. Is there a way to leave it to loop the block when moving?
Image
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot]