Skip to content

Instantly share code, notes, and snippets.

@jeremyckahn
Created November 8, 2015 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyckahn/d5444bba32099348682a to your computer and use it in GitHub Desktop.
Save jeremyckahn/d5444bba32099348682a to your computer and use it in GitHub Desktop.
RPG Maker MV plugin to autoload a saved game when the game boots
/* globals PluginManager, SceneManager, Scene_Load, DataManager */
/*:
* @plugindesc Autoload a saved game when the game boots
* @param File ID
* @desc The 1-based index of the file to load
* @default 1
* @author Jeremy Kahn
*/
(function () {
'use strict';
function poll () {
if (SceneManager._scene && SceneManager._scene.commandContinue) {
SceneManager.push(Scene_Load);
var parameters = PluginManager.parameters('AutoloadGame');
DataManager.loadGame(parameters['File ID'] || 1);
setTimeout(function () {
SceneManager._scene.onLoadSuccess();
}, 100);
} else {
setTimeout(poll, 10);
}
}
poll();
}());
@jeremyckahn
Copy link
Author

Also really hacky... but it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment