
1.0.1
Ever wanted to call a sound effect in your scripts after, say, 30 frames have passed? Or how about wait 60 seconds before you render a sprite with the bitmap Cache.system("gone_4_60_s")? Well now you can, with this teeny tiny and easy-to-use script!
Introducing the fantabulous TDD::Timer.call_after_frames!
You use it like this:
TDD::Timer.call_after_frames( :frames => Number, - Number of frames to wait before calling :method
bserver => Object, - Object for which method should be called :method => :symbol, - Method to call on
bserver Object
arams => Object, - OPTIONAL: Any object you wish to pass to the :method)Real world example:
SpoilerHere it is used (in combination with my Ease animation script) to match the sound effects to the animation, by using delayed calls to methods that call the sound effect:
One of those calls look like this:
# Audio: Play fall againTDD::Timer.call_after_frames(observer: self, method:
lay_shatter_sfx, frames: 170)
You know the drill: Put it somewhere
below ▼ Materials but
above ▼ Main Process
You can get it on github directly here; this link will always be up-to-date with the latest stable version:
https://raw.githubusercontent.com/TorD/TDD-Timer/master/script.rb
If you want to follow the development, or report bugs, please use the GitHub repository found here:
https://github.com/TorD/TDD-Timer
Free for non-commercial and commercial use. Credit greatly appreciated but not required. Share script freely with everyone, but please retain the description area unless you change the script completely. Thank you.
Galenmereth / Tor Damian Design
Feeling generous?
If you would like to give me a small tip to help me spend even more time making and maintaining these free scripts, do consider supporting me on
Gratipay. Any and all support will be greatly appreciated.
本贴来自国际rpgmaker官方论坛作者:Galenmereth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/timer-call-methods-after-x-frames.34671/