Animation Save Bug Fix

Fogomax

Veteran
Veteran
Joined
Nov 5, 2015
Messages
36
Reaction score
164
First Language
Portuguese

Animation Save Bug Fix


 


Introduction
This is a quick fix requisited by RHachicho, the plugin fixes fixes the bug that turns impossible to save the game while an event running in parallel mode is playing an animation on itself.
 
How to use
Save the plugin in a .js and move it to js/plugins folder.



Plugin Code


//=============================================================================
// Animation Save Bug Fix (v1.2)
// by Fogomax
//=============================================================================

/*:
* @author Fogomax
* @plugindesc This plugin fixes the bug that turns impossible to save the game
* while an event running in parallel mode is playing an animation on itself.
*
* @help
* ===========================================================================
* » Description
* ===========================================================================
*
* This plugin fixes the bug that turns impossible to save the game while
* an event running in parallel mode is playing an animation on itself.
*
* It is plug-and-play, no configuration is required. Place this plugin on
* the top of the plugin list.
*
* ===========================================================================
* » License
* ===========================================================================
* WTFPL – Do What the frick You Want to Public License
* http://www.wtfpl.net/txt/copying/
*/

(function() {
'use strict';

//-----------------------------------------------------------------------------
// DataManager
//

var _DataManager_makeSaveContents = DataManager.makeSaveContents;

DataManager.makeSaveContents = function() {
var contents = _DataManager_makeSaveContents.call(this);
if (contents.map) {
var events = contents.map._events;
this.resolveCircularReference(events);
}
return contents;
};

DataManager.resolveCircularReference = function(events) {
for (var i = 0; i < events.length; i++) {
if (!events) continue;
if (events._interpreter && events._interpreter._character === events) {
events._interpreter._character = null;
}
}
};

})();


Github: https://github.com/rafaelalmeidatk/JGSS/blob/master/AnimationSaveBugFix.js


Changelog


v1.2 - Fixed some typos


v1.1 - Changed the fix to DataManager.makeSaveContents method instead of Scene_Map.prototype.terminate


v1.0 - Creation of the plugin



Usage
This plugin is free for both commercial and non-commercial projects, no credits required.





 
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top