While it will be fine doing so in many cases, in general loading and saving the game is not supposed to be done in the middle of the games update cycle (when event commands would be run).
At this point, the events to update for the frame are already decided, and switching to a different savestate will continue updating those events, but many references to other events, switches, the player character etc. will use the freshly loaded data instead, which might trip the game up.
I'd recommend using a plugin for this one to move the execution of your loading script outside the main update routine:
Code:
// --------------------------------------------------------------------------
// After Map Update Routine
//
// @plugindesc Allows to reserve a script to be run after the map update
// cycle.
// @help Use
// $gameTemp.afterUpdate = function() {
// // ... your script ... //
// };
// to move the execution of your script outside the map update cycle.
// Scene switches caused by events (Battle Processing etc.) and the
// message box will take precedence over the reserved script.
//
// It's recommended to put this as close to the bottom of your plugin
// list as possible.
// --------------------------------------------------------------------------
(function() {
var sceneMapUpdateMain = Scene_Map.prototype.updateMain;
Scene_Map.prototype.updateMain = function() {
sceneMapUpdateMain.call(this);
if ($gameTemp.afterUpdate && this.isAfterUpdateOk()) {
var callback = $gameTemp.afterUpdate;
$gameTemp.afterUpdate = null;
callback();
}
};
Scene_Map.prototype.isAfterUpdateOk = function() {
return this.isSceneChangeOk();
};
})();
to move the execution of your script call and finish updating events and player first. (Haven't tested the plugin yet though, but in general this should be a way to go)
part is usually only done to reset the current map if the game has since been updated. It resets all events and parallel processes, which you might not want when loading the game normally. If that is the case you can make this part conditional and only reset the map if you updated your project since (the default loading process):
Code:
if ($gameSystem.versionId() !== $dataSystem.versionId) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
}
to save the game. and if i use the normal save command from the menu its working with the plugins. i guess i have to put something in the code that saves the plugins?
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.