Last frame of animation stays on screen

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Last frame of animation stays on screen

#1 Post by chesarty »

You heard it. I try to play a little animation to show that the player has gained more affection points, but once it reaches the final frame, it just stays on the screen. Alternatively, if I define the animation in a different way, it loops infinitely.

This code makes it loop:

Code: Select all

image affection_plus_ten = Animation ("plusten1.png", 0.2, "plusten2.png", 0.2, "plusten3.png", 0.2, "plusten4.png", 0.2, "plusten5.png", 0.2, "plusten6.png", 0.2, "plusten7.png", 0.2, "plusten8.png", 0.2, "plusten9.png", 0.2, "plusten10.png", 0.2)
Aaaand this one makes it get stuck:

Code: Select all

image affection_plus_ten:
    "plusten1.png"
    0.1
    "plusten2.png"
    0.1
    "plusten3.png"
    0.1
    "plusten4.png"
    0.1
    "plusten5.png"
    0.1
    "plusten6.png"
    0.1
    "plusten7.png"
    0.1
    "plusten8.png"
    0.1
    "plusten9.png"
    0.1
    "plusten10.png"
    0.1
    
I tried to look into it but the only advice I found was "oh, don't put 'repeat' at the end and it's gonna be fine" but that's not what's happening for me.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Last frame of animation stays on screen

#2 Post by Alex »

You can show an empty (fully transparent) image at the end of this animation - create the image file or make it like

Code: Select all

image empty_img:
    Solid("#0000")

image affection_plus_ten:
    "plusten1.png"
    0.1
    "plusten2.png"
    0.1
    "plusten3.png"
    0.1
    "plusten4.png"
    0.1
    "plusten5.png"
    0.1
    "plusten6.png"
    0.1
    "plusten7.png"
    0.1
    "plusten8.png"
    0.1
    "plusten9.png"
    0.1
    "plusten10.png"
    0.1
    "empty_img"

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Last frame of animation stays on screen

#3 Post by rayminator »

or you can put a repeat like this

Code: Select all

image affection_plus_ten:
    "plusten1.png"
    0.1
    "plusten2.png"
    0.1
    "plusten3.png"
    0.1
    "plusten4.png"
    0.1
    "plusten5.png"
    0.1
    "plusten6.png"
    0.1
    "plusten7.png"
    0.1
    "plusten8.png"
    0.1
    "plusten9.png"
    0.1
    "plusten10.png"
    repeat
    

Post Reply

Who is online

Users browsing this forum: No registered users