Save and Load

● ARCHIVED · READ-ONLY
Started by Jonini 10 posts View original ↗
  1. Hi, I want to create a system for saving and loading, but I have already searched the Internet and can not find what I need! I want to insert the script \ plugin command into the event and that when I activated event, I automatically saved the game in 1 slot, and then, when I entered the game again, I could load the same automatic save (without the save menu), Load play and keep playing! I'm begging!!! I will be very grateful!
  2. This may have to be moved to JS Plugin Requests, but I'll leave it here for the time being in case there is a way of doing this without a plugin.
  3. I guess instead of searching the internet you should have looked at the core scripts.
    rpg_scenes contains these two methods inside Scene_Load:

    Code:
    Scene_Load.prototype.onSavefileOk = function() {
        Scene_File.prototype.onSavefileOk.call(this);
        if (DataManager.loadGame(this.savefileId())) {
            this.onLoadSuccess();
        } else {
            this.onLoadFailure();
        }
    };
    
    Scene_Load.prototype.onLoadSuccess = function() {
        SoundManager.playLoad();
        this.fadeOutAll();
        this.reloadMapIfUpdated();
        SceneManager.goto(Scene_Map);
        this._loadSuccess = true;
    };

    So you need to properly extract the code from these functions:
    Code:
    if (DataManager.loadGame(you need to add the savefile id here)) {
            
    SoundManager.playLoad();
        SceneManager._scene.fadeOutAll();    
    if ($gameSystem.versionId() !== $dataSystem.versionId) {
    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
    $gamePlayer.requestMapReload();
    }
        SceneManager.goto(Scene_Map);
        SceneManager._scene._loadSuccess = true;
       }
  4. Кes, i'm new here, so I do not know where and what is here. Sorry
  5. Poryg said:
    I guess instead of searching the internet you should have looked at the core scripts.
    rpg_scenes contains these two methods inside Scene_Load:

    Code:
    Scene_Load.prototype.onSavefileOk = function() {
        Scene_File.prototype.onSavefileOk.call(this);
        if (DataManager.loadGame(this.savefileId())) {
            this.onLoadSuccess();
        } else {
            this.onLoadFailure();
        }
    };
    
    Scene_Load.prototype.onLoadSuccess = function() {
        SoundManager.playLoad();
        this.fadeOutAll();
        this.reloadMapIfUpdated();
        SceneManager.goto(Scene_Map);
        this._loadSuccess = true;
    };

    So you need to properly extract the code from these functions:
    Code:
    if (DataManager.loadGame(you need to add the savefile id here)) {
           
    SoundManager.playLoad();
        SceneManager._scene.fadeOutAll();   
    if ($gameSystem.versionId() !== $dataSystem.versionId) {
    $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
    $gamePlayer.requestMapReload();
    }
        SceneManager.goto(Scene_Map);
        SceneManager._scene._loadSuccess = true;
       }

    Poryg, i, of course, do not know programming very well (I learn), and as far as I understand
    "DataManager.loadGame (you need to add a savefile here)" to use it as a script in the creator of the RPG, and it will be loading, but did not understand with saving.
  6. @Poryg, please answer, it is very important to me!
  7. Jonini, please do not bump your topic unless it has been 24 hours later since your last post. You can review our forum rules here. Thank you.


    It hasn't even been more than 30 minutes since your last post. We all have lives and some of us live in different time zones, so please be patient.
  8. @Jonini you have an additional problem in that your idea will either not work or scare away all players.
    You need to answerr several questions for yourself before anything can work:

    1) how does the player start a new game if he wants to?
    2) what should happen if the player wants to use different saves? Simply disabling different saves completely will scare people away.
    3) when should a game be saved? autosaves are always a problem by frustrating players who don't want to save yet or frustrating players who need to save often because they can't play long times.

    Additionally, you just broke several rules again.
    You are required to wait 72 hours - yes, three days - before bumping a question. Not 44 minutes between your last two posts. It doesn't matter to us how important something is to you - we are helping in our own free time, no one gets paid here on the forum. And it is considered rude to demand help faster than those people have time...

    Edit: ninja'd by mod
  9. slimmmeiske2 said:
    [bump]Jonini[/bump]
    It hasn't even been more than 30 minutes since your last post. We all have lives and some of us live in different time zones, so please be patient.

    He simply did not respond within 4 days, I deleted the old message so that you would not say that I create similar messages, I decided to write 2 more times, I just decided not to save, because I was busy with this for 2 weeks and did not find answer, I want to make a game with a choice of level, I wanted these levels not to open before, but I will open all levels, but I wanted this: so, when I pass a level, I will have a game in 1 slot, so, when a player comes 2 times, he can move to the old level and not start from the very beginning.
    Sorry for the violations.
  10. When people say "I don't know programming very well"... When making a game in RPG maker uses programming logic just as much as programming language. Only the syntax is greatly simplified.

    Anyway, once again you search for functions that handle the saving, but this time not on Scene_Load, but on Scene_Save, because we're handling saving this time. Coincidentally they are named the same.
    Code:
    Scene_Save.prototype.onSavefileOk = function() {
    Scene_File.prototype.onSavefileOk.call(this);
    $gameSystem.onBeforeSave();
    if (DataManager.saveGame(this.savefileId())) {
    this.onSaveSuccess();
    } else {
    this.onSaveFailure();
    }
    };
    
    Scene_Save.prototype.onSaveSuccess = function() {
    SoundManager.playSave();
        StorageManager.cleanBackup(this.savefileId());
    this.popScene();
    };

    Once again it's just code extraction.
    Code:
    $gameSystem.onBeforeSave();
    if (DataManager.saveGame(insert your ID) {
    StorageManager.cleanBackup(insert your ID);
    }

    And you were correct, the code can be used in the script field of an event.