Save and Load

Jonini

Villager
Member
Joined
Oct 23, 2018
Messages
20
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
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!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
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;
   }
 

Jonini

Villager
Member
Joined
Oct 23, 2018
Messages
20
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
Кes, i'm new here, so I do not know where and what is here. Sorry
 

Jonini

Villager
Member
Joined
Oct 23, 2018
Messages
20
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
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.
 

Jonini

Villager
Member
Joined
Oct 23, 2018
Messages
20
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
@Poryg, please answer, it is very important to me!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

Jonini, please do not bump your topic unless it has been 72 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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
@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
 

Jonini

Villager
Member
Joined
Oct 23, 2018
Messages
20
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
[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.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top