Animation with placeholder images

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
recreation
Regular
Posts: 52
Joined: Sun Jul 01, 2018 8:32 am
Contact:

Animation with placeholder images

#1 Post by recreation »

Hi.
I'm trying to make several animations with several images. The images are named "g_fist00.png", "g_fist01.png", "g_fist02.png"and so on.
I have several animations like this, "g_knee.png", "g_jump.png", etc and use placeholder for the images: "images/anim/2/g_knee[frame].png".
Think of it as a fighting game with the attacks being animated.
This works so far, but I have one big problem. Either the animation loops forever and I have to hide it after the first loop, which doesn't work well because not all animations have the same length and if the framerate drops, there is a visible gap between the animation and the next image/animation.
If I don't let it loop and "show" the following image/animation after I "show" the animation, then the following image pops up directly after the first frame of the animation and both are there until the animation finished...
How can I make this work?

And because I simply hacked all of this together without knowing much about it: What's the best way to do this in general? Using placeholder for images/animations I mean. I had a look at the documentation several times, but it's more confusing than explaining and without any examples I just don't get it.
The best solution would be one where I put a "repeat" at the end, like the usual animation, but I didn't find a way to use it yet.

Btw I noticed some interesting behavior while testing this. I wanted to see if renpy can handle 60fps without lag and using different ATL method didn't work well, but using the old "Renpy.image(Animation..." made the animation flawless without any lag at 60fps (even with fhd frames).
I'm not a professional coder nor do I know much about python, so can anyone confirm this? What's the reason for this?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]