Tile Animation Rate

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,819
Reaction score
1,277
First Language
EN
Primarily Uses
RMMZ
Tile Animation Rate
by caethyril

Update! :kaojoy:
I now have one big thread for all my plugins, including an enhanced version of this one:
https://forums.rpgmakerweb.com/index.php?threads/caethyrils-plugins.106255/

Features :kaohi:
This is a small plugin that will allow you to adjust how frequently animated map tiles update. It also provides the ability to add an on/off option to the in-game Options window, for slower systems (e.g. mobile) on which animated tiles may cause lag.

How to Use :kaopride:
Download the attached .js file and place it in your project's folder, under js/plugins. Then open RMMV, go to Tools > Plugin Manager, double-click an empty line to add a new plugin, and select this plugin from the drop-down list. To edit the values of any of the parameters displayed to the right of the drop-down, double-click them in the list.

Troubleshooting :kaoback:
If you experience problems with this plugin that you want to report, please post here and include the following:
  • Instructions stating how to reproduce the problem in a new project.
    (If I can't reproduce the problem, I probably can't help you.)
  • A screenshot of the console when the unexpected behaviour occurs.
    (You can open the console by pressing F8 during test-play.)

Terms of Use :kaothx:
Free to use, repost, and/or modify, for commercial or non-commercial projects.
Credit to Caethyril is appreciated but not required.

Full Code (Cae_TileAnimRate.js) :kaoswt2:
Code:
//=============================================================================
// Cae_TileAnimRate.js
//=============================================================================

/*:
 * @plugindesc v1.1 - Lets you specify the rate at which animated map tiles cycle their animation. Can also add an on/off switch to the in-game options.
 * @author Caethyril
 *
 * @help Plugin Commands:
 *   None.
 *
 * Compatibility:
 *   Aliases update method of the Tilemap class,
 *       and addGeneralOptions method of Window_Options.
 *   Defines new Boolean property tileAnimRate on the ConfigManager.
 *
 * Terms of use:
 *   Free to use and modify.
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Update log:
 *   1.1: Added on/off switch to the in-game options.
 *   1.0: Initial release.
 *
 * @param Tile Animation Rate
 * @text Tile Animation Rate
 * @type number
 * @min 0
 * @max 60
 * @desc Tile animation rate in frames per second.
 * Default: 2
 * @default 2
 *
 * @param Options Label
 * @text Options Label
 * @type text
 * @desc Text shown for this setting in the in-game options.
 * Leave blank to not add the option.
 * @default
 */

var Imported = Imported || {};			// Import namespace, var can redefine
Imported.Cae_TileAnimRate = 1.1;		// Import declaration

var CAE = CAE || {};				// Author namespace, var can redefine
CAE.TileAnimRate = CAE.TileAnimRate || {};	// Plugin namespace

(function (_) {

'use strict';

	_.params = PluginManager.parameters('Cae_TileAnimRate');			// Process user parameters

	_.rate  = Number(_.params['Tile Animation Rate']) || 2;
	_.label = String(_.params['Options Label']) || '';

	_.active = true;		// Default option value

	// Adjust animationCount prior to the standard +1 per call
	_.Tilemap_update = Tilemap.prototype.update;			// Alias
	Tilemap.prototype.update = function() {
		if (_.active) this.animationCount += _.rate / 2;	// animationCount cuts off at 30 so divide by 2 here
		this.animationCount -= 1;				// Cancel out +1 from default code
		_.Tilemap_update.call(this);				// Callback
	};

	// Add option to ConfigManager
	Object.defineProperty(ConfigManager, 'tileAnimRate', {
		get: function() 	{ return _.active;  },
		set: function(value) 	{ _.active = value; },
	configurable: true });

	// Adds option to Window_Options
	_.Window_Options_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
	Window_Options.prototype.addGeneralOptions = function() {
		_.Window_Options_addGeneralOptions.call(this);
		if (_.label !== '') this.addCommand(_.label, 'tileAnimRate');
	};

})(CAE.TileAnimRate);

More by the same Author :kaoslp:
I have a variety of other (mostly small utility) plugins on my Google Drive here:
https://drive.google.com/drive/folders/0B47clJwJZOS0U2xrbGF0YUpoeEE
 

Attachments

Last edited:

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
693
Reaction score
213
First Language
Vietnamese
Primarily Uses
RMMV
This might be off-topic, but i have checked your plugins in your Google Drive folder, and i found your Time Stop Battlers was very useful for some certain states like Frozen or Petrified. It does freeze the motions of battlers, but when they get attacked, they still play 'hurt' motion, or play 'evade' motion when evading an attack. Could you please make it to completely stop their motions at the moment the state is applied to them, even when they get attacked or evade an attack?
And i also find that it would be more comfortable (and even good to build patch to fix the game after release) if you can make it to use note tag for each state instead of editing them in the plugin manager.
Thank you very much for your awesome plugins.
 

Creative Ed

Veteran
Veteran
Joined
Sep 16, 2013
Messages
318
Reaction score
329
First Language
Portuguese
Primarily Uses
RMMV
Hi, thanks for this script!
I would like to request a feature I've been looking for a while, and I think this plugin would be perfect for it.
Is it possible to add the possibility of changing the water animtion scheme from 1,2,3,2,1,2,3 to a cycle animation of 1,2,3,1,2,3.
It's very useful for those who have custom graphics and would like to make a loopable water animation. Thanks!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,819
Reaction score
1,277
First Language
EN
Primarily Uses
RMMZ
@JamesRyan I uploaded an updated version of TimeStopBattlers to my Drive, which should stop the unwanted motion changes and allow for notetags. :kaojoy:

@Creative Ed Sorry, I've been looking at it today and haven't figured out how to do it (does sound like a good idea, though!). I think the WebGL renderer uses ShaderTilemap, but I can't seem to find where it picks the next frame for animated tiles. :kaoswt2:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I made the parts to simplify my actions.
"Humble Bundle Sound Designer Bundle" just noticed this with a day left. Useful for those of you who want to mix your own music. :LZSwink:
Lots of artists very active right now :)
I'll try all of my gestures.

This Is Vasily. I like him very much

Forum statistics

Threads
103,084
Messages
997,147
Members
134,550
Latest member
michaeljordig
Top