How to Get Animation Frame Durations

From Yanfly.moe Wiki
Revision as of 16:46, 24 January 2024 by Arisu (talk | contribs) (Created page with "{{TOCright}} {{Hide Sidebar}} {| style="width: 800px;" cellspacing="0" cellpadding="0" | style="width: 100%; vertical-align: top;" | == Introduction == File:FrameCountTut...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Introduction

FrameCountTutorial1.png

Ever wanted to figure out how many frames an animation is? You probably know that in RPG Maker MV, the animation frames listed in the database don't equal the wait duration in the game. Or in RPG Maker MZ, the Effekseer animations don't even have durations listed at all. Here's how to figure them out.

This will be a TL;DR article without all the fluff text.

ArisuAvatar2.png This is an article written by Arisu.


Instructions

Step 1

FrameCountTutorial2.png

First, create a new event.


Step 2

FrameCountTutorial3.png

Next, create a Control Variable event command with this as the Script value:

Graphics.frameCount

Make sure Set is selected.


Step 3

FrameCountTutorial1.png

Next, make the event play the animation you want to time.

Make sure Wait for Completion is checked.


Step 4

FrameCountTutorial4.png

Next, create a Control Variable event command with this as the Script value:

Graphics.frameCount

Make sure Sub(tract) is selected.


Step 5

FrameCountTutorial4b.png

Follow that up with another Control Variant event command and Multiply it by -1.


Step 6

FrameCountTutorial5.png

Finally, create a Show Message displaying the variable value with the variable code listed:

Duration: \V[20]


Final Event

FrameCountTutorial6.png

This is what the final event should look like.


Test It Out

Time to play test.

FrameCountTutorial7.png

Yay, it works!


Conclusion

That's it. Nothing terribly special or verbose. Just some quick get it out of the way stuff for people who know their way around RPG Maker and just want to get things done.


End of Article