Changing player's animation frame rate but not actual speed

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
Hello,

I'm using Shaz's More Character Frames plugin, and my main avatar has 14 frames for each walking direction. In other words, the sprite sheet is 14 columns and 4 rows.

The problem is that the animations are cycling too slowly, causing a "skating" effect. I need a way to speed up the FPS of the animations while not changing the actual speed at which the player moves from one tile to the next. I tried messing with Set Movement Route > Change Frequency, but that didn't do anything at all.

In searching for a solution, I came across an old post here that had a working solution, but it was for VX Ace. Is there something similar to that for MV?

Thanks!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Move frequency relates to the delay between moves, but doesn't apply to the player even when undergoing a forced move route.

By default the animation frame rate is determined by the character's speed:
Code:
Game_CharacterBase.prototype.animationWait = function() {
  return (9 - this.realMoveSpeed()) * 3;
};
So for a speed 4 character there's a delay of 15 frames (1/4 second) between every animation frame.

To change this, just save a copy of that code as a .js file (Save As > File Type: All Files, filename: WhateverYouLike.js), edit the formula as desired, and import like a plugin. E.g. maybe change the 3 to a 2. Note that this is for Game_CharacterBase, i.e. it'll affect all map characters (player, events, vehicles). If you only want to affect the player, try this instead~
Code:
Game_Player.prototype.animationWait = function() {
  return (9 - this.realMoveSpeed()) * 2;
};
It seems to work for me! :kaopride:
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
It works for me too. Once again, thanks, caethyril!
 

Gryffin

Villager
Member
Joined
Dec 15, 2013
Messages
21
Reaction score
2
First Language
English
Primarily Uses
Super noob question here. Where do I find the code you mentioned, caethyril? I've looked in my game folder in documents and the rpg maker mv folder in steam, but I can't find any code that has game_characterbase. What type of file is it? Where is it located? Thanks.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Super noob question here. Where do I find the code you mentioned, caethyril? I've looked in my game folder in documents and the rpg maker mv folder in steam, but I can't find any code that has game_characterbase. What type of file is it? Where is it located? Thanks.
If you open your project folder (e.g. from the editor's menu: Game > Open Folder) and look in the js folder, you should see a bunch of files with names like rpg_core.js, rpg_managers.js, etc. These are the "core script files" for your project. In this case you're after rpg_objects.js: it contains code pertaining to most of the common high-level objects in a game, including the player, events, actors, enemies, map, etc. It's probably also the easiest one to relate to, since it's the least abstracted from gameplay. :)

Note that it's generally inadvisable to edit the core script files; instead you can write "plugins" (separate .js files) containing additional code. Plugins go in the appropriate subfolder and get loaded after the core script files. You can use plugins to replace existing object definitions (simply by defining a new object with the same name, a.k.a. "identifier"), extend them (e.g. by adding new properties to an existing object), or add new ones.

Since I'm not sure how new to coding you are...you can edit .js (JavaScript) files with something like Notepad, but there exist dedicated code editors that can make things much easier. I personally use Visual Studio Code for JavaScript:
Also, Trihan has written a tutorial you might find helpful:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top