Hello! I'm making a system in my game that uses save slots for one thing. I already have a way to forcefully save in a certain slot, but I haven't been able to find a way to forcefully load the slot that I want from a Script call or a plugin, could someone help me? Thanks for reading 😀
MV Need help with force load! [SOLVED]
Javascript/Plugin Supportwhat do you expect from a force load and when?
if you want to save on 1 slot during gameplay and not open the
save scene, TSR_Save can help you on that part, as it has an
autosave feature as well + customisation.
for loading the save is something you need to explain more.
if you want to save on 1 slot during gameplay and not open the
save scene, TSR_Save can help you on that part, as it has an
autosave feature as well + customisation.
for loading the save is something you need to explain more.
For auto saving, you should only need a force save function in order to make sure that the player cannot manually overwrite the autosave. But for loading, you shouldn't need that because there is no reason as to why you would restrict when a player can load a save.
So if you want to load the save that was forcefully saved, you can just ... load it, I guess?
So if you want to load the save that was forcefully saved, you can just ... load it, I guess?
try looking through this code from an old plugin of mine, jumpStart:
forums.rpgmakerweb.com
MV - Skip title+autoload+autosave
So what I need is a plugin (or a tutorial how to make existing ones work) that can do the following: - When running a game file, it skips the title and automatically loads the last saved file - Autosave the game using a plugin command or script call - When no saved file is present, a new game...
forums.rpgmakerweb.com
To resolve your doubts, my game does not use the loading and saving scenes of the base rpg maker because they seem boring to me, so I had to do them by events, the problem is that when loading a saved file, I have not found anything to manually load the file that I indicate from the event. The save is already implemented, I'm missing the load.
I don't mean auto save, I want a script call that loads a slot that I have specified in an event or a plugin to do this.
And I have to say that I have absolutely no idea about javascript, so searching in a code for me is like finding a needle in a haystack
Here's an example script call from the MV / MZ Script Call List (Continue/Load):
Link to the list:
forums.rpgmakerweb.com
// Continue from save slot 4
if (DataManager.loadGame(4)) {
$gameSystem.onAfterLoad();
SceneManager._scene.fadeOutAll();
if ($gameSystem.versionId() !== $dataSystem.versionId) {
var p = $gamePlayer;
p.reserveTransfer($gameMap.mapId(), p.x, p.y, p.direction(), 0);
p.requestMapReload();
}
SceneManager.goto(Scene_Map);
}Link to the list:
RPG Maker MV / MZ Script Call List
This Script Call list applies to both RPG Maker MV and RPG Maker MZ. Link here to see the entire list. Supplementary Material for RPG Maker MZ: https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mz-script-call-reference.122501/ Have fun eventing~
forums.rpgmakerweb.com
Thank you so much! This was what I was looking for! 😀
if you had 1 save slot, and yo udo the evented way, you should have
said so in your topic, so we dont have to guess 🙂
so be clear next time as well.
TSR_Save can provide 1 slot save and ca load directly to the game
if you please so "true continue" or overwrite the continue that way.
if you dont provide the neccessary info, we need to ask questions,
instead for a straight answer what you look for.
it's hard for us to guess what you seek with low information.
said so in your topic, so we dont have to guess 🙂
so be clear next time as well.
TSR_Save can provide 1 slot save and ca load directly to the game
if you please so "true continue" or overwrite the continue that way.
if you dont provide the neccessary info, we need to ask questions,
instead for a straight answer what you look for.
it's hard for us to guess what you seek with low information.
Edit: Had tried to retract the post before I saw caethyril had already responded to it. But this is what it originally said:
Concerning caethyrils post:
I would advise caution with this particular script though. In the vast majority of cases this should work fine, but in theory loading a savestate through a script call in the middle of the games update process (when events commands would be run) could cause unintended effects that might be hard to track down.
[Example and alternative proposal retracted due to flaws, see next post]
Concerning caethyrils post:
I would advise caution with this particular script though. In the vast majority of cases this should work fine, but in theory loading a savestate through a script call in the middle of the games update process (when events commands would be run) could cause unintended effects that might be hard to track down.
[Example and alternative proposal retracted due to flaws, see next post]
I don't see how your proposed code changes anything? (
popScene on an empty stack will exit the game, but you could just change the push(loadingScene) to a goto in that case.)Thoughts:
$gameMapgets replaced with data loaded from the save file.
SceneManager.goto(Scene_Map)tells the game to empty the stack and initialise a new map scene instance, which includes reloading$dataMap. This should happen the frame after the script call is evaluated.
- The rest of the current update cycle for event commands should effectively be skipped because
Game_Interpreter#updateincludes aSceneManager.isSceneChangingcheck.
I messed up a bit both with the example given and the code, although the general concern might still stand if you are using Plugins that work on the map.
The concern was that while $gameMap and other game objects get replaced, your are in the middle of the old $gameMaps update function when that happens, meaning the rest of that function call will still use "this" to access the old map. The old maps events will still get executed, but calls to game objects will work on the newly loaded objects (during passability checks for example).
I was indeed wrong with the example of the parallel event changing a variable though, thanks for pointing it out. =) That makes it indeed less likely to cause chaos. ^^
Sorry for that.
The "Switch On/Off..." move route commands might still interfere with a newly loaded savestate. Not sure who actually uses that command though...^^
And yeah, the code I posted... 🙁
The code was way too long to fit in a script command anyway it turned out.
I had to stealthily fix the "this.popScene()" to "if (!SceneManager.isSceneChanging()) this.popScene()" so you might have seen the even more wrong version...^^
The purpose was just to have a fallback should loading the game fail and the SceneManager.goto(Scene_Map) line never get executed.
The idea of the changes was to let Scene_Map complete all its updates for the frame just in case before changing to the handcrafted scene to load a new game. Unfortunately it was obvious I didn't try to test that thing first...^^
May do another proposal on that later if nobody else does. :)
The concern was that while $gameMap and other game objects get replaced, your are in the middle of the old $gameMaps update function when that happens, meaning the rest of that function call will still use "this" to access the old map. The old maps events will still get executed, but calls to game objects will work on the newly loaded objects (during passability checks for example).
I was indeed wrong with the example of the parallel event changing a variable though, thanks for pointing it out. =) That makes it indeed less likely to cause chaos. ^^
Sorry for that.
The "Switch On/Off..." move route commands might still interfere with a newly loaded savestate. Not sure who actually uses that command though...^^
And yeah, the code I posted... 🙁
The code was way too long to fit in a script command anyway it turned out.
I had to stealthily fix the "this.popScene()" to "if (!SceneManager.isSceneChanging()) this.popScene()" so you might have seen the even more wrong version...^^
The purpose was just to have a fallback should loading the game fail and the SceneManager.goto(Scene_Map) line never get executed.
The idea of the changes was to let Scene_Map complete all its updates for the frame just in case before changing to the handcrafted scene to load a new game. Unfortunately it was obvious I didn't try to test that thing first...^^
May do another proposal on that later if nobody else does. :)
Since the thread starter has marked the thread "[SOLVED]"...
PS @yawk: in future you can report your post, e.g. with a reason like "Solved". That highlights the thread for the moderators and clearly communicates that you'd like the thread to be closed. 👋
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.
Feel free to start your own thread or message me or whatever if you find a reproducible test case (without plugins) showing that the script call I posted can cause bugs, though!PS @yawk: in future you can report your post, e.g. with a reason like "Solved". That highlights the thread for the moderators and clearly communicates that you'd like the thread to be closed. 👋
Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-force-load-solved.148814/