Is it normal for rpg maker (mv or not) when saving during dialogue, it will instead load to the next dialogue?

I try to use conditional branches to make a parallel process event to call the save menu when dialogue/show text event is playing, and it works

The main problem is that whenever I load the save is that it's always shows the next dialogue and not the current dialogue

I see that people use plugins to circumvent this issue, but my gut feeling says that something like saving during dialogues are possible without plugins

I've tried to comb through internet for answers, and I found that there's not really a fixed answer to this problem

I'm actually fine if its impossible to save during dialogue anyways, I can always scrap the mechanic, I just want to learn
The problem is that no matter what, you cannot save during the execution of any single event command.
even with so-called "parallels" the save command will either be before or after a show text, never during it. (you can follow the link "bughunting" in my signature to learn more about that).

only with a plugin you can rewrite the event codes to allow for something like that, and even then it is not simple to save in a way that the show text is displayed both before and after the save.
Ohhhh, that actually explains a lot on why the saves are like that
It is a bummer that natively the engine can't save during events, but it is what it is
I think you can subtract from the $gameMap._interpreter._index in the parallel event script box (push Scene_Save in the same box I guess). And then put another script box where you add to the index after the save.

But you'd have to know what you're doing with the indexes. Seems like at least the number of lines in a text box affects it. You can check that with $gameMessage._texts.length but you probably have to account for other stuff too.
The issue is that when a message is being displayed, the interpreter's index is already pointing at the next one. So if you save it with that index, it will be set up to show the next message when you load.

In addition to handling rewinding the interpreter index, you also need to ensure that *choices* are properly reinstated, and that involves saving the callbacks. Here's how we did it in our game:

JavaScript:
const _DataManager_makeSaveContents = DataManager.makeSaveContents;
    DataManager.makeSaveContents = function() {
        const contents = _DataManager_makeSaveContents.call(this);
        if ($gameMessage._choiceCallback) $gameMessage._choiceCallbackStr = $gameMessage._choiceCallback.toString();

        if ($gameMessage.callbacks) {
            $gameMessage._callbacksStr = [];
            $gameMessage._callbacksStr = $gameMessage.callbacks.map(callback => callback.toString());
        }
        contents.messages = $gameMessage;
        return contents;
    };

    const _DataManager_extractSaveContents = DataManager.extractSaveContents;
    DataManager.extractSaveContents = function(contents) {
        _DataManager_extractSaveContents.call(this, contents);
        $gameMessage = contents.messages || new Game_Message();
        if ($gameMessage._choiceCallbackStr) {
            let interpreter = contents.map._interpreter;
            while (interpreter._childInterpreter != null) {
                interpreter = interpreter._childInterpreter;
            }
            const callback = function(str) {
                return eval(str);
            }.call(interpreter, $gameMessage._choiceCallbackStr);
            $gameMessage.setChoiceCallback(callback);
            delete $gameMessage._choiceCallbackStr;
        }
        if ($gameMessage._callbacksStr) {
            $gameMessage.callbacks = [];
            for (const callbackStr of $gameMessage._callbacksStr) {
                const callback = function(str) {
                    return eval(str);
                }.call(contents.map._interpreter, callbackStr);
                $gameMessage.callbacks.push(callback);
            }
            delete $gameMessage._callbacksStr;
        }
    };
The issue is that when a message is being displayed, the interpreter's index is already pointing at the next one. So if you save it with that index, it will be set up to show the next message when you load.

In addition to handling rewinding the interpreter index, you also need to ensure that *choices* are properly reinstated, and that involves saving the callbacks. Here's how we did it in our game:

JavaScript:
const _DataManager_makeSaveContents = DataManager.makeSaveContents;
    DataManager.makeSaveContents = function() {
        const contents = _DataManager_makeSaveContents.call(this);
        if ($gameMessage._choiceCallback) $gameMessage._choiceCallbackStr = $gameMessage._choiceCallback.toString();

        if ($gameMessage.callbacks) {
            $gameMessage._callbacksStr = [];
            $gameMessage._callbacksStr = $gameMessage.callbacks.map(callback => callback.toString());
        }
        contents.messages = $gameMessage;
        return contents;
    };

    const _DataManager_extractSaveContents = DataManager.extractSaveContents;
    DataManager.extractSaveContents = function(contents) {
        _DataManager_extractSaveContents.call(this, contents);
        $gameMessage = contents.messages || new Game_Message();
        if ($gameMessage._choiceCallbackStr) {
            let interpreter = contents.map._interpreter;
            while (interpreter._childInterpreter != null) {
                interpreter = interpreter._childInterpreter;
            }
            const callback = function(str) {
                return eval(str);
            }.call(interpreter, $gameMessage._choiceCallbackStr);
            $gameMessage.setChoiceCallback(callback);
            delete $gameMessage._choiceCallbackStr;
        }
        if ($gameMessage._callbacksStr) {
            $gameMessage.callbacks = [];
            for (const callbackStr of $gameMessage._callbacksStr) {
                const callback = function(str) {
                    return eval(str);
                }.call(contents.map._interpreter, callbackStr);
                $gameMessage.callbacks.push(callback);
            }
            delete $gameMessage._callbacksStr;
        }
    };
Wait this is your team's plugin?

Now I want to try it...

Say, what are your guys's terms of use with this plugin?
Wait this is your team's plugin?

Now I want to try it...

Say, what are your guys's terms of use with this plugin?
It's part of a larger one, but you're welcome to use the message-saving code from it.
It's part of a larger one, but you're welcome to use the message-saving code from it.
Cool! One of the projects I'm working on is noncommercial anyways so you don't have to worry, also under who should I credit this plugin? plus does this plugin play well with other plugins?
Cool! One of the projects I'm working on is noncommercial anyways so you don't have to worry, also under who should I credit this plugin? plus does this plugin play well with other plugins?
Please credit AuraMZ if you use the snippet. It should play fine with others, all it does is add extra save data that can reconstruct objects on load that usually don't get saved.
Please credit AuraMZ if you use the snippet. It should play fine with others, all it does is add extra save data that can reconstruct objects on load that usually don't get saved.
Ok, the plugin works but the choices aren't loading as it should

I can simply tell the players that that they can't save during choices though

Thank you for the plugin, it has helped me a lot

Original thread: https://forums.rpgmakerweb.com/threads/is-it-normal-for-rpg-maker-mv-or-not-when-saving-during-dialogue-it-will-instead-load-to-the-next-dialogue.181395/