Changing which foot a sprite has forward

Hey all!

I am planning to animate some environment objects by making sprites that turn clockwise every few milliseconds. I discovered that I can fit three separate animations into a single "character" by having a different one in each vertical column. If the sheet's "right foot forward" frame is selected in the event editor, the right foot will remain forward as the character rotates, letting me store animations three times more efficiently than the chests and doors that come with the program.

As far as I can tell, however, there is no option in the movement routing to change which foot the character has forward. If I wanted to play a twelve frame animation, I would have to play four frames of one sprite, four frames of another, and four frames of a third! In the interest of organization, I am hoping I can just play the four right-foot frames, the four standing frames, and the four left foot frames in a single movement route with no hacked-together solutions like spreading it across three switch pages.

Is there perhaps a simple line of script that can change whether the character's left foot, right foot, or standing frame is selected? Since I can set it in the event editor, I assume it has to be stored somewhere, and it would let me play twelve-frame animations with a simple "90 right, 90 right, 90 right, 90 right, SCRIPT, 90 right, 90 right, 90 right, 90 right, SCRIPT" and so on.
Stepping animation on for a few frames, then stepping animation off. Turning the events would help too. This should achive the effect you want, but it takes careful timing

Edit: Additinally, if these events are noninteractable. You can make the event parrelel process and add a second move route in its event page, Again, this would take careful timing

Edit: You could also take tips from this video
@Myriad Sure, you can manually set the '_direction' (row) and '_pattern' (column) of each frame using simple script calls within a Move Route command. However, we will need to first tinker with the '_animationCount' variable. We need to do this because '_animationCount' controls when the game switches between patterns and animates a standard walk cycle. Usually 1 or 1.5 is added to the variable until it reaches a set value at which point it switches to the next pattern. So, if we set '_animationCount' to a large, negative number every time the Move Route is executed, the event will never reach the required value and we can basically do whatever we want.

Code:
// Depending on how long the animation is, you may want to raise or lower the following value.
// This really only needs to be set in the first line of your Move Route.
this._animationCount = -900;

// Row 1 - Down
this._direction = 2;
// Row 2 - Left
this._direction = 4;
// Row 3 - Right
this._direction = 6;
// Row 4 - Up
this._direction = 8;

// Column 1
this._pattern = 0;
// Column 2
this._pattern = 1;
// Column 3
this._pattern = 2;

// Example :
// Row 1 + Column 3
this._direction = 2; this._pattern = 2;
Edit: nevermind
@Ossra Works like a charm! Manually setting the row and column feels much more solid than relying on rotation, too. Thank you very much!

I appreciate your help too, Oddball, though that route would be a little risky for my tastes. It reminds me of some of the old tricks back in RPGM2K.
No problem. once you would get the timing down it wouldn't be risky anymore, but i'm glad you found a solution nontheless
I was attempting a similar thing, and this has been extremely helpful!
I've got one rookie issue that I can't seem to get past when using it, though.

For adjusting the framerate of animations, I've been staggering the appropriate line of script with Wait commands (please let me know if there's a better way to do it than that). Anything below a 5-frame wait (10fps animation) looks fine, but the longer the wait between lines of script, the more likely the animation is to stutter and blink. It also seems that sometimes it will ignore what I set as the final frame of an animation and default to something else on the sprite sheet. I was wondering if there's some way to circumvent that; I essentially just want to say "show this sprite and don't change to anything else until I say so."
I was wondering if there's some way to circumvent that; I essentially just want to say "show this sprite and don't change to anything else until I say so."
Turn the Walking/Stepping Animations OFF, and turn Direction Fix ON.
Alternately, you could switch to a different character model ("Change Character Graphic") that just has the same exact sprite in all 12 spots.
Turn the Walking/Stepping Animations OFF, and turn Direction Fix ON.
Alternately, you could switch to a different character model ("Change Character Graphic") that just has the same exact sprite in all 12 spots.
Direction Fix did it! Thank you very much!
@Skoops Remember that 1 or 1.5 is added to the '_animationCount' variable each frame. So, the longer your animation, the more '_animationCount' approaches a positive number. Once it reaches a value of 6 or so, it will automatically attempt to switch to another animation frame, causing stuttering. -(2*W) where W is the total amount of frames dedicated to wait commands used in your animation should give enough time for everything to complete. The '_animationCount' just needs to be a large enough negative number to keep the normal operation of sprites in MV from taking over.



EDIT: Or we could do something super rude and freeze '_animationCount'. Then we never have to worry about it resetting for that event :

Code:
// Instead of using the following to temporarily delay the animation count ...
this._animationCount = -900;

// We use the following ...
Object.defineProperty(this, '_animationCount', { value: -1, writable: false });

This will forever lock '_animationCount' at a value of -1 for that event.
No problem. once you would get the timing down it wouldn't be risky anymore, but i'm glad you found a solution nontheless
Necro I know... How do you restart the animation?

edit: got it duh me....

How would I approach doing this in a plugin? I'd rather not have to use a parallel event every scene.

Original thread: https://forums.rpgmakerweb.com/threads/changing-which-foot-a-sprite-has-forward.113689/