Created
November 8, 2015 01:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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(); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also really hacky... but it works!