Myriad

Warper
Member
Joined
Sep 27, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
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.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,019
Reaction score
584
First Language
English
Primarily Uses
N/A
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
 
Last edited:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
868
First Language
English
Primarily Uses
RMMV
@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;
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,019
Reaction score
584
First Language
English
Primarily Uses
N/A
Edit: nevermind
 
Last edited:

Myriad

Warper
Member
Joined
Sep 27, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
@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.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
2,019
Reaction score
584
First Language
English
Primarily Uses
N/A
No problem. once you would get the timing down it wouldn't be risky anymore, but i'm glad you found a solution nontheless
 

Skoops

Villager
Member
Joined
Oct 4, 2019
Messages
21
Reaction score
15
First Language
English
Primarily Uses
RMMV
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."
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,835
First Language
English
Primarily Uses
RMVXA
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.
 

Skoops

Villager
Member
Joined
Oct 4, 2019
Messages
21
Reaction score
15
First Language
English
Primarily Uses
RMMV
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!
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
868
First Language
English
Primarily Uses
RMMV
@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.
 
Last edited:

Latest Threads

Latest Profile Posts

How come there's no spooktober game jam? I thought horror maker games were some of the most popular genre out there...
"I didn't know X song was about that!" Uh... why? Do you not listen to the lyrics? I mean, I guess that makes sense. We live in a world where nobody listens, but everyone wants to be heard.
Coding class: Python
Game dev work: Javascript
Result: AHHH!!! Writing program for an assignment and having it crash and burn because I used Javascript syntax or format. Or having my game die on me because of a python call :yswt:
Can we make it so whenever a banned user tries to use their account whilst banned, the forum should redirect to this
Anyone doing anything for NaNoWriMo this year?

Forum statistics

Threads
115,835
Messages
1,093,323
Members
151,027
Latest member
Mansfield40matt
Top