subengari

Veteran
Veteran
Joined
Dec 12, 2020
Messages
36
Reaction score
14
First Language
king's english
Primarily Uses
RMMV
Compadres and comadres,

In MV, the SpriteAnimation class had a property ._rate, which would determine the frame rate of the animations.

I realize that MZ now uses Effekseer and has the legacy SpriteAnimationMV class... but if I am using a Effekseer animation that I created is there any way to change it's frame rate?

In my MV projects, I used to be able to change the frame rate depending on the animation that I was using for aesthetic purposes. I'd like to be able to do the same in MZ if possible without having to use SpriteAnimationMV.

Muchísimas gracias for the help!
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,815
Reaction score
9,152
First Language
Indonesian
Primarily Uses
RMVXA
There is no "framerate" in Effekseer. However, you can adjust the speed of the animation in the database already, if that is what you mean.
 

subengari

Veteran
Veteran
Joined
Dec 12, 2020
Messages
36
Reaction score
14
First Language
king's english
Primarily Uses
RMMV
There is no "framerate" in Effekseer. However, you can adjust the speed of the animation in the database already, if that is what you mean.
@TheoAllen - Frame rate, as in the number of frames that are displayed per second.

I would like to be able to change this dynamically using the script rather than hard settings in the database.

I looked over the SpriteAnimation class but can't seem to find a property to set this.

So, by asking, I am hoping that somebody has tackled this issue before and will share their knowledge with me.
 

subengari

Veteran
Veteran
Joined
Dec 12, 2020
Messages
36
Reaction score
14
First Language
king's english
Primarily Uses
RMMV
Ok, so I looked into @TheoAllen ' s suggestion of changing the animation speed, but rather than go through the database, I wrote something that modifies Sprite_Animation._animation.speed.

It's a percentage value, so I am assuming that 100% = 60 fps.

Unfortunately changing it during gameplay, before the animation executes using a script command, results in an error with PIXI, after the animation plays-

pixi_error.PNG
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,815
Reaction score
9,152
First Language
Indonesian
Primarily Uses
RMVXA
Frame rate, as in the number of frames that are displayed per second.
Again, Effekseer does not use "frame rate". The fact that you can use a speed multiplier, it is using some sort of easing function to render the effect, and the speed is the factor to reduce/accelerate it. So, technically it isn't "frame rate".

I would like to be able to change this dynamically using the script rather than hard settings in the database.
Implying that you want to change the speed of animation 1 to 150% (from 100%) in the database. Consider changing this particular function.

JavaScript:
Spriteset_Base.prototype.createAnimation = function(request) {
    const animation = $dataAnimations[request.animationId];
    // Pseudo code
    // If <request change speed exists for this animation id>
    //   make a deep copy of the animation data then change the speed
    const targets = request.targets;
    const mirror = request.mirror;
    let delay = this.animationBaseDelay();
    const nextDelay = this.animationNextDelay();
    if (this.isAnimationForEach(animation)) {
        for (const target of targets) {
            this.createAnimationSprite([target], animation, mirror, delay);
            delay += nextDelay;
        }
    } else {
        this.createAnimationSprite(targets, animation, mirror, delay);
    }
};

If you want to change the animation speed when it is being played. It might be a little bit complicated. The best I found is this code.
JavaScript:
Sprite_Animation.prototype.updateEffectGeometry = function() {
    const scale = this._animation.scale / 100;
    const r = Math.PI / 180;
    const rx = this._animation.rotation.x * r;
    const ry = this._animation.rotation.y * r;
    const rz = this._animation.rotation.z * r;
    if (this._handle) {
        this._handle.setLocation(0, 0, 0);
        this._handle.setRotation(rx, ry, rz);
        this._handle.setScale(scale, scale, scale);
        this._handle.setSpeed(this._animation.speed / 100);
    }
};
 

Latest Threads

Latest Posts

Latest Profile Posts

Dog saliva is an antiseptic.
NghNgE9.gif
Oh man. IGMC's finally back. I really want to participate, but I'm not sure if I have the time.
It is DC's turn to be celebrating her leveling up and starts her 20th year. We were many to think she wouldn't live that long. Starts your cats motors and make 'em purr!
why_hello_mira.jpg

I made myself a cult leader, and a concept scene for him as well. :LZSexcite:

Forum statistics

Threads
123,311
Messages
1,155,712
Members
161,737
Latest member
sin88betfun
Top