How to halt the "walking" animation when changing an event image to a character?

Since I've been making games in RPG Maker MZ, there is one small thing I've never found a solution for, and that is this following situation:

A player companion is dismissed, which I then script to have an event become that companion. For example, Actor 2 is removed from the party, and the event EV021 takes on the appearance of Actor 2. This is straightforward and works the way it should, but I have a problem with the "walking" animation frames of the character being shown. It doesn't look like the event is standing still. It looks as if the event is in mid-stride, stuck in the middle of a walking animation.

This happens when I use a "Set Movement Route" command, which contains the instructions to "turn down" and then to change the event image to that of the actor. It doesn't matter whether the turn command is down, left, right, or up, the event always looks as if it is stuck in the middle of walking.

I've tried using the "Walking Animation OFF" and "Stepping Animation OFF" commands, which don't fix this problem for me. I've even tried using both, and in combination with the "Direction Fix ON" command, butI haven't been able to solve this. I've also tried using the "Set Event Location" command in various ways and in combination with the above methods, but nothing seems to make the event look like it is standing still.

Does anyone have any advice for me on how to solve this? I'm sure I'm just overlooking something really simple.
Hmmmm, I remember having this problem but can't replicate it now...did they fix it in later version?

Anyway, I think the solution is like script in the move route (change Xs to event id):
$gameMap.event(X)._originalPattern = 1; $gameMap.event(X).resetPattern();
The stepping frame (a.k.a. "pattern") to which an event resets when stopped is its "original pattern". This value is determined by the image chosen for its active page. If no image (or a tile) is chosen, the original pattern is 0, i.e. the left column of the character block.

Here are some approaches to work around this:
  1. Make a "blank character" spritesheet and use that instead of "Image (None)";
  2. Instead of Change Image, activate a different page of the event that has the appropriate image;
  3. Use a script call like this in the move route, before the first Change Image command:
    JavaScript:
    this._originalPattern = 1;
    The original/"resting" pattern for no-image characters is 0, but for characters with an image it is 1. The original pattern is usually updated when the event changes page.
The stepping frame (a.k.a. "pattern") to which an event resets when stopped is its "original pattern". This value is determined by the image chosen for its active page. If no image (or a tile) is chosen, the original pattern is 0, i.e. the left column of the character block.

Thank you so much for explaining the reason why this happens! I have to wonder though, why wouldn't it default to the middle position?

In any case, out of the suggestions that you gave me, the first one is the easiest and most straightforward to use:

Make a "blank character" spritesheet and use that instead of "Image (None)"

Thanks for solving this problem for me, and thanks to all who had suggestions.
I have to wonder though, why wouldn't it default to the middle position?
Perhaps the devs just thought it didn't matter. Or perhaps there's a reason for it that I'm not seeing.

Anyway, happy RPG Making! 😂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-halt-the-walking-animation-when-changing-an-event-image-to-a-character.177095/