Developing an Auto-Save feature.

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Hello, I am curious to learn some scripting behind this feature. I am aware Hudell has an autosave script that I'm going to use, but I would like to know if there was a solution to my exploration before finding Hudell's script.

I learnt that the following code (3 being the save ID) saves the current gameplay to that save slot.


◆Script:$gameSystem.onBeforeSave();
: :DataManager.saveGame(3);


However, I do not know how to adjust the save ID to that of the currently playing file. I came across:


DataManager::last_savefile_index

But haven't been able to use that. If I can figure out how to obtain the save ID currently being used (or last loaded), I think I would be able to do this without Hudell's script.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You're looking at two different engines there.  The script snippet you have is from MV, but DataManager::last_savefile_index is from VX Ace.  Explains why you can't use it.  It's not in MV.


I am assuming you're using MV (might be a good idea to update your profile to say that).


DataManager.saveGame(DataManager.lastAccessedSavefileId());
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Thank you very much!! The problem's been solved.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top