MZ [SOLVED] Spinning Sprite using all 12 Frames or More

It's been a while since I used the forum and there are probably already scripts of what I'm looking for out there, but they are either the wrong ones, or the directions are vague and complex. Here is what I am looking for. I am looking for a script that is a spinning animation for sprites such as objects like rocks, crystals, or in this case cards like this:
$deathspade.png

A similar script would be to individually pick certain sprites from within the character. Can anyone help me with this, please?
Code:
/*:
 * @plugindesc Provides an easy script call to force events to use certain frames
 */
Game_Character.prototype.advanceFrame = function(wait) {
    this._pattern++
    if (this._pattern >= 3) {
        this._direction += 2;
        this._pattern = 0;
        if (this._direction == 10) this._direction = 2;
    }
    if (wait) this._waitCount = wait - 1;
};
 
Game_Character.prototype.setFrame = function(frame, wait) {
    this._direction = 2 * Math.ceil((frame + 1) / 3);
    this._pattern = frame % 3;
    if (wait) this._waitCount = wait - 1;
};

Here's some code from a previous jam project I did. Save the above scripts as a .js and install as a plugin Use the script call this.advanceFrame() so the character cycles through each animation frame.

this.setFrame() lets you pick which frame to use.

Frames also start counting at zero so the top-left frame is frame zero. Because I designed these functions specifically for cutscene movement routes they might behave a little funny when used for autonomous movement as they require you set a specific wait time
Code:
/*:
 * @plugindesc Provides an easy script call to force events to use certain frames
 */
Game_Character.prototype.advanceFrame = function(wait) {
    this._pattern++
    if (this._pattern >= 3) {
        this._direction += 2;
        this._pattern = 0;
        if (this._direction == 10) this._direction = 2;
    }
    if (wait) this._waitCount = wait - 1;
};
 
Game_Character.prototype.setFrame = function(frame, wait) {
    this._direction = 2 * Math.ceil((frame + 1) / 3);
    this._pattern = frame % 3;
    if (wait) this._waitCount = wait - 1;
};

Here's some code from a previous jam project I did. Save the above scripts as a .js and install as a plugin Use the script call this.advanceFrame() so the character cycles through each animation frame.

this.setFrame() lets you pick which frame to use.

Frames also start counting at zero so the top-left frame is frame zero. Because I designed these functions specifically for cutscene movement routes they might behave a little funny when used for autonomous movement as they require you set a specific wait time
It does not seem to work. The game gives me the error that this.advanceFrame and this.setFrame are not functions. It also told me that this script can only be used in MV since the info about this plugin in the manager was blank.
It does not seem to work. The game gives me the error that this.advanceFrame and this.setFrame are not functions. It also told me that this script can only be used in MV since the info about this plugin in the manager was blank.
Are you using it in the character move route?
Are you using it in the character move route?
I did that at first and then tried it in the regular event as a parallel trigger. It's still giving me the same error:

TypeError
this.setFrame is not a function
Nevermind, I got it working and I was warned that it would behave funny. The animation is very jerky. Sorry. This is no good, but thanks for the suggestion. Also, this.advanceFrame works too, but I can't control the speed.
You could try this in a Movement Route command (You'll have to use the corresponding event commands in the move route) :
Code:
◇ Script : this._animationCount = -300
◇ Script : this.setDirection(2); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(4); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(6); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(8); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames

You could set this as a separate movement route and set it to repeat.
The negative animation count is to delay the animation cycle for the pattern of the event. Change the Wait time to fit your animation needs. You are essentially manually doing each animation frame. The direction changes and 0 pattern needs to be on the same script call so that it can happen at the same time.

This is a lot harder to maintain so if you could use a plugin, I would recommend that instead. I believe Yanfly's Move Route Core has a lock pattern where you can lock a specific pattern (still need to do it manually though). Otherwise, this is good for small scale stuff.
You could try this in a Movement Route command (You'll have to use the corresponding event commands in the move route) :
Code:
◇ Script : this._animationCount = -300
◇ Script : this.setDirection(2); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(4); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(6); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames
◇ Script : this.setDirection(8); this.setPattern(0)
◇ Wait 3 Frames
◇ Script : this.setPattern(1)
◇ Wait 3 Frames
◇ Script : this.setPattern(2)
◇ Wait 3 Frames

You could set this as a separate movement route and set it to repeat.
The negative animation count is to delay the animation cycle for the pattern of the event. Change the Wait time to fit your animation needs. You are essentially manually doing each animation frame. The direction changes and 0 pattern needs to be on the same script call so that it can happen at the same time.

This is a lot harder to maintain so if you could use a plugin, I would recommend that instead. I believe Yanfly's Move Route Core has a lock pattern where you can lock a specific pattern (still need to do it manually though). Otherwise, this is good for small scale stuff.
There was one plug-in where extra frames were used in a straight line, like this:
deathspade0000-sheet.png

But I can't seem to find that plug-in here. I don't know if it would work the same way.
There was one plug-in where extra frames were used in a straight line, like this:
View attachment 291133
But I can't seem to find that plug-in here. I don't know if it would work the same way.
Galv's Character Frames for MZ might be worth considering:

https://galvs-scripts.com/2020/08/31/mz-character-frames/
Galv's Character Frames for MZ might be worth considering:

https://galvs-scripts.com/2020/08/31/mz-character-frames/
Looks like it works. The cards are rotating and the player can interact with it with no problems. I did have to do some tinkering with the graphics, but this has proven useful. Thanks to all who helped, I appreciate it. I'm marking this as solved.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-spinning-sprite-using-all-12-frames-or-more.164563/