MZ Custom chest opening animation

Hello people who live in my computer!

I need help with a chest opening animation. The sprite sheet is slightly different from the normal chests, and it's really tripping me up. I don't have permission to share the sheet, so I made a highly accurate representation (see below). I numbered each frame in the order it's supposed to go. It's 12 frames, starting in the upper left corner. First column goes down, second column goes up, third column back down.

As you might have guessed, the normal Set Movement Route doesn't work for this. I've tried a few different things and I just can't seem to get it to animate correctly. Direction Fix OFF >> Turn Down >> Turn Right >> Turn Down seemed intuitive, but it just kind of stutters and looks strange. I've read a few tutorials (such as this one), so maybe I need a script call?

I'll take any help you all can offer. Ευχαριστώ!
That's pretty easy, as the tutorial you linked explains. To go from frame 4 to 5, put this in a move route script call:
JavaScript:
this._pattern = 1
And to go from frame 8 to 9, use this:
JavaScript:
this._pattern = 2
The rest should be doable with normal Turn commands. You'll also need Wait commands between each one, if you haven't tried that already.

The tutorial said to use _originalPattern instead of _pattern. I'm fairly sure _pattern works though – I recall using it in some of my own move routes. I'm not sure what reason there would be to use _originalPattern instead.
Ok, trying your script, I think I'm messing up the turn commands. Can you see what I've got wrong here?
I don't see any issues with that move route, though it is a bit strange that the wait after the pattern changes is longer than the other waits.

What problem are you seeing?
you have "this._pattern" while the tutorial have this._originalPattern = y
which you may need. but other than that, it should work.
are the walking and stepping animations disabled? if not they would automatically change the patterns.

and can you give a screenshot of the entire event? It might be something outside the set moveroute command that causes problems for the event.
Also, regarding the script call:
Nice! 😂

I'm guessing the "glitchy" behaviour of the script call is because the current pattern isn't immediately being set to the new value. Character patterns automatically reset to the _originalPattern value when they've been "stopped", i.e. not stepping/walking, for a certain period of time (based on their move frequency).

You can manually reset to _originalPattern using character.resetPattern(), e.g.
Spoiler: Click to see script call examples
  • In a Script command (map event ID 1):

    $gameMap.event(1)._originalPattern = 1; $gameMap.event(1).resetPattern();

  • In a Script command (This Event):

    this.character(0)._originalPattern = 1; this.character(0).resetPattern();

  • In a move route (This Event):

    this._originalPattern = 1; this.resetPattern();
If all else fails you can also simply rearrange the spritesheet to only use the middle/idle column by making it a full character sheet instead of a single one. That way you'd use the same moveroute the quick event chests do and then you'd just change the image to the next column and reverse it or do it again, depending on how you arranged it.
Here's a screenshot of the event as it was. I've tried some of the more recent suggestions.

I switched to this._originalPattern = y and evened out the wait, it still looks like it's hiccuping somewhere in the center. The second screenshot is the updated version.
Instead of this:
  • this._originalPattern = 1
Use this:
  • this._originalPattern = 1; this.resetPattern();
(Same idea for _originalPattern = 2 as well.)
Instead of this:
  • this._originalPattern = 1
Use this:
  • this._originalPattern = 1; this.resetPattern();
(Same idea for _originalPattern = 2 as well.)

You mad genius! It worked! The animation plays correctly now, and it looks gorgeous. Thank you, and everybody else, for all your help.

Original thread: https://forums.rpgmakerweb.com/threads/custom-chest-opening-animation.183861/