Fix "Change Event's Image" command?

Hello. I was creating an event that would set three events to use your party members' images:

for(var i = 1; i < $gameParty.members().length; i++) { var classe = $dataClasses[$gameParty.members()[i]._classId].name; var gender = $gameParty.members()[i]._gender || 0; $gameMap.event(i+1).setImage(classe, gender); $gameMap.event(i+1).turnTowardPlayer(); console.log($gameMap.event(i+1)); }

And this part worked. What does not work, however, is how the "characters" look:
eventsposition.png

Basically they're always stuck in their "taking a step" position, no matter the rotation. Is there a way to make them "stand straight"?

EDIT: Aight, found a solution:

for(var i = 1; i < $gameParty.members().length; i++) { var classe = $dataClasses[$gameParty.members()[i]._classId].name; var gender = $gameParty.members()[i]._gender || 0; $gameMap.event(i+1).setImage(classe, gender); $gameMap.event(i+1).turnTowardPlayer(); $gameMap.event(i+1)._originalPattern = 1; }

"_originalPattern" determines which column in the event's character sheet to set it back after he completed a movement.

Chierico.png


In this case it was set to zero, meaning that, whenever it would stop moving, the event would use the column on the left as its sprite. Changing "_originalPattern" to 1, instead, would make it use the column in the middle.
I'm not 100% certain, but my guess is that since the original events don't have an image set, their _pattern (which represents the current step state) defaults to 0, while the "stand straight" _pattern is 1.

There are a number of ways to set the _pattern to 1, but perhaps the most fitting one is:
JavaScript:
$gameMap.event(i+1).straighten();

I say "most fitting" because what's more fitting than to use a function called "straighten" when you want a character to "stand straight"? 😂
While I don't have a solution to offer you for your situation, if this is something you're going to do frequently in your game, I do recommend Tyruswoo's Follower Control:

It has very simple plugin commands for moving your followers via move routes, changing their poses, etc. I've made very good use of it.
I say "most fitting" because what's more fitting than to use a function called "straighten" when you want a character to "stand straight"? 😂
You have a point XD

EDIT: apparently "straighten()" doesn't work. My guess is that it simply sets the event pattern to its original, which in this case will always be 0. You need to directly change the "_originalPatter" parameter
EDIT: apparently "straighten()" doesn't work. My guess is that it simply sets the event pattern to its original, which in this case will always be 0. You need to directly change the "_originalPatter" parameter
Sorry about that. It appears that the engine calls resetPattern() at some point, which does indeed set _pattern to whatever _originalPattern is.
Sorry about that. It appears that the engine calls resetPattern() at some point, which does indeed set _pattern to whatever _originalPattern is.
Don't worry, the help was still really appreciated ^^

Original thread: https://forums.rpgmakerweb.com/threads/fix-change-events-image-command.142259/