Force Save without menu

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
323
First Language
English
I'm wondering if there's a script that will force a save to a particular save slot without the save menu showing up.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
I'm wondering if there's a script that will force a save to a particular save slot without the save menu showing up.
it's just one line of code:

DataManager.save_game(1)where 1 is index of the save slot 
 
Last edited by a moderator:

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
323
First Language
English
Oh. I see. Thanks. I wouldn't have been able to know that by myself, since I don't dabble with the scripts directly if I don't have to.

Is there a way to have it return a value if it succeeds? Or is that too much to ask?
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Oh. I see. Thanks. I wouldn't have been able to know that by myself, since I don't dabble with the scripts directly if I don't have to.

Is there a way to have it return a value if it succeeds? Or is that too much to ask?
It returns true or false by default.

It will also delete any previous save if the operation fails.
 

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
323
First Language
English
...Okay. Let me approach this a different way. Say I had a use-able event that would do this, and then throw a textbox on whether it worked or not. How would I hook up the return to an if event, then?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
...Okay. Let me approach this a different way. Say I had a use-able event that would do this, and then throw a textbox on whether it worked or not. How would I hook up the return to an if event, then?
Just put that one line of script in a conditional branch and it should work as intended.

Check the attached image to see the event.

savegame.png
 

JoePro

None Newb
Veteran
Joined
May 29, 2014
Messages
78
Reaction score
17
First Language
English
Primarily Uses
The only delema whould be your current save slot vs game you are playing.

DataManager.save_game(1) works good if you are only allowing one save spot. Otherwise you will need a way to keep track of which save slot to save over. So in other words its not just a one liner. You will need a script that allows you to have global variables to keep track of how many new profiles you have and the one for each profile to hold its own value.
 
Last edited by a moderator:

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
323
First Language
English
Naturally. I had only intended for one save slot anyways.
 

Stupidbro

Veteran
Veteran
Joined
Jul 8, 2019
Messages
87
Reaction score
8
First Language
English
Primarily Uses
RMVXA
The only delema whould be your current save slot vs game you are playing.

DataManager.save_game(1) works good if you are only allowing one save spot. Otherwise you will need a way to keep track of which save slot to save over. So in other words its not just a one liner. You will need a script that allows you to have global variables to keep track of how many new profiles you have and the one for each profile to hold its own value.
Sorry to necropost (if 6 years later qualifies), but I happen to know a way to keep track of which save slot was the last one that any one specific game used (In short, it tells which game slot the player is using for this game), which could be helpful for anyone who comes across this.
Ruby:
$game_variables[1] = DataManager.last_savefile_index
This sets the first game variable to the last save slot this game used. (If they saved on File 1, the variable is equal to 0, if File 2, it sets to 1, etc)

Using these two ideas together,
Ruby:
$game_variables[1] = DataManager.last_savefile_index
DataManager.save_game($game_variables[1])
Should save onto the last save slot used. This should work as well:
Ruby:
DataManager.save_game(DataManager.last_savefile_index)
 

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,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top