Jump to content
AeroFunk80

Auto-Save/Forced Save

Recommended Posts

I've done Google searches and have found several AutoSave scripts out there. However, I haven't found quite what I'm looking for.


 


In the scripts I've discovered, they simply AutoSave after certain criteria is met in the game: Player Transfer, Weapon/Armor/Item Found, after a Battle, etc. I'm not looking for an AutoSave feature to happen like this. I don't even know if you'd consider what I'm looking for as an "AutoSave."


 


What I'm looking for is the following:


 


  • When a player Saves, they aren't taken to the save screen, where they can choose to select which slot to save in: saving new, overwriting, etc.
  • When the player reaches a Save point in my game (specifically a bonfire) it asks, "Do you want to save?" I then want it to just automatically save to a preset Save slot and that's their permanent save spot for their entire playthrough.
  • I want the option to force a Save. This is what I want the most. My game has several quests that can result in multiple things happening (someone dies, the players actions result in a change to the story, etc) and I want these choices to be permanent. I want to keep the Player from stopping the game and just reloading their last Saved Game.

 


Example: Player hits a Bonfire at the beginning of a dungeon. This saves the game to their predetermined Save slot. It automatically overwrites their previous Save they did last. Halfway through the dungeon, the player is hit with a choice to rescue an NPC from a dungeon or leave him chained up. Once the choice is made, I want a way to force the save on the player. They have no choice after they make their decision. It just autosaves at that point and there's no going back. And no, the save window doesn't pop up asking the player to Save (with the option to cancel). It just autosaves because I script it into the Event.


 


Does something like this already exist? If so--I couldn't find it.


 


Thanks for any help I can get. Really appreciate it :-)


Share this post


Link to post
Share on other sites

I'm not sure how many people will agree with me, but the thing about forcing a save after influential choices sounds like a really bad idea.  If the outcome is undesirable for the player, and they can't just reload their save to change it and see what happens, they may very well rage quit.  In fact, the first idea is pretty bad too.  You realize that doing so is forbidding the backing up of saves, considering there is no option to copy the save file to an empty slot from the load screen.  Do you know how many raging players that would create if the game you have in mind is anywhere near difficult?  Fyi it wouldn't be a good think if so many players became upset by this mechanic and spread the word that your game is so bad, even if it's not, but they think it is because they rage quit when they did something that they later found out was irreversible?  Mind you it isn't the only possible outcome, but it is still a possibility.  I have to ask, did you question whether you would enjoy playing through your game at least a dozen times to get the full story of every possible outcome?  I really don't think there's a game in existence that could keep me interested that long.

 

On another note, I'm no scripter, but considering how saving works by default, I don't think it's possible to bypass the save menu to save directly to a preset file, or if there is I don't think it's been found yet.

Edited by devonm0

Share this post


Link to post
Share on other sites

You can use script call in events to 'force' save to certain slot.

Just put this:

Sound.play_save # if you want to play save sound; remove if you don't want sound
DataManager.save_game(0) # (#) - is the save slot, it starts from 0, so 0 = 1slot; 1 = 2slot; 2 = 3slot etc. etc.

And your game will be saved.

You can put that in save points, where message appears first, for example:

<msg> Do you want to save?

<choice>

 >YES

   -put the save code here and the game will be saved instantly without the Save scene

 >NO

   -just ends event

 

You can add something like auto save by yourself - put that code after/before some scenes etc. in events.  You have the full control here.

Edited by Rikifive
  • Like 3

Share this post


Link to post
Share on other sites

You can use script call in events to 'force' save to certain slot.

Just put this:

Sound.play_save # if you want to play save sound; remove if you don't want sound
DataManager.save_game(0) # (#) - is the save slot, it starts from 0, so 0 = 1slot; 1 = 2slot; 2 = 3slot etc. etc.

And your game will be saved.

You can put that in save points, where message appears first, for example:

<msg> Do you want to save?

<choice>

 >YES

   -put the save code here and the game will be saved instantly without the Save scene

 >NO

   -just ends event

 

You can add something like auto save by yourself - put that code after/before some scenes etc. in events.  You have the full control here.

 

I gave this a try, but it only deleted my save file rather then overwriting it. Could be a project specific issue though.

 

POST EDIT: Just tried it in a new (different) project, still didn't work.

Edited by StrayBalloon

Share this post


Link to post
Share on other sites

That's weird, I tried that now on my project - it saved perfectly, opened a new project and did the same - it saved perfectly.

I really don't know why it's not working for you.

Share this post


Link to post
Share on other sites

While there might be slight controversy surrounding this, I'm in favor of a script that will force a save, although I would probably just have it where manual saving was disabled and had it auto-save after checkpoints in the game. I would want to do this very much for the same reason you cited: it makes choices have greater weight and there are no takebacks. I might have to try this script when I get home.

 

For the purposes of testing, I have my game open to saving whenever, but I eventually I'm going to wall it off.

Share this post


Link to post
Share on other sites

That's weird, I tried that now on my project - it saved perfectly, opened a new project and did the same - it saved perfectly.

I really don't know why it's not working for you.

 

I think I figured it out. It's Khas awesome light effects that causes the file to be deleted rather then overwritten.

Share this post


Link to post
Share on other sites

But... How is this possible? It's just a simple script call, how can it be affected? I'd understand scripts, that changes the save structure, but not that... I'm curious why is that happening, so I think I need to watch out for that I guess... Hmm.. But the normal save (via Save Scene) should not work as well, because it uses the same code. This is really weird.

Share this post


Link to post
Share on other sites

Thanks for those that helped with this LOL I love games that do that. What's the point of creating a game with choices that have consequences, if you can just stop, reload and start over to get the result you want?

 

 

You can use script call in events to 'force' save to certain slot.

Just put this:

Sound.play_save # if you want to play save sound; remove if you don't want sound
DataManager.save_game(0) # (#) - is the save slot, it starts from 0, so 0 = 1slot; 1 = 2slot; 2 = 3slot etc. etc.

And your game will be saved.

You can put that in save points, where message appears first, for example:

<msg> Do you want to save?

<choice>

 >YES

   -put the save code here and the game will be saved instantly without the Save scene

 >NO

   -just ends event

 

You can add something like auto save by yourself - put that code after/before some scenes etc. in events.  You have the full control here.

You have no idea how much I appreciate this! I literally posted that code into a script, and it worked my first time! FANTASTIC!

 

I realize this would cause controversy, in a game I was actually marketing and trying to sell to people. LOL I'm just creating something for friends to play, and they always talk about how RPGs are too easy and forgiving, and what's the point of having a game where your choices have consequences if the player can just "rage quit", start over and select the option they want.

 

The Souls games. Auto saves, and you have no choice. Any decision you make in that game is permanent and there's no going back. And those are fantastic games. Of course--my game is NOWHERE near as good as Dark Souls and Bloodborne :-) But just sayin'

 

Thanks again! Script works great!! :-)

  • Like 1

Share this post


Link to post
Share on other sites

Also... since the script above auto-saves to the specific slot during your game, I added a message at the beginning of my game to choose a SAVE slot: Save 1, Save 2 or Save 3.

 

The player will choose their SAVE slot, and I created a Switch depending on the one they chose. That Switch is then at each Save Point/Event and will auto save to that slot for the duration of the game. That's their game's permanent save slot, unless they choose to start over.

 

For those of you interested in using this.

Share this post


Link to post
Share on other sites

There was already a script to do this.

 

Totally achievable with removing some features from that script.

 

 

#===============================================================================
# )----------------------------------------------------------------------------(
# )--     AUTHOR:     Mr. Trivel                                             --(
# )--     NAME:       Roguelike Save System                                  --(
# )--     CREATED:    2015-05-08                                             --(
# )--     VERSION:    1.0                                                    --(
#===============================================================================
# )--                         VERSION HISTORY                                --(
# )--  1.0  - Initial script.                                                --(
#===============================================================================
# )--                          DESCRIPTION                                   --(
# )--  One slot per game save. Can only save when returning to title.        --(
# )--  Save is deleted on death.                                             --(
# )--  Infinite save files.                                                  --(
#===============================================================================
# )--                          INSTRUCTIONS                                  --(
# )--                          Plug && Play                                  --(
# )--                                                                        --(
# )--  You can forcefully save the game with a script call (in event or      --(
# )--  common event):                                                        --(
# )--  save_game                                                             --(
#===============================================================================
# )--                          LICENSE INFO                                  --(
# )--  Free for non-commercial & commercial games if credit was given to     --(
# )--  Mr Trivel.                                                            --(
# )----------------------------------------------------------------------------(
#===============================================================================

# )=======---------------------------------------------------------------------(
# )-- Module: RogueSaving                                                    --(
# )---------------------------------------------------------------------=======(
module RogueSaving
  
  # )--------------------------------------------------------------------------(
  # )-- How will Save & Quit be called in menu?                              --(
  # )--------------------------------------------------------------------------(
  SAVE_AND_QUIT_TEXT = "Save & Quit"
end

# )=======---------------------------------------------------------------------(
# )-- Class: Game_System                                                     --(
# )---------------------------------------------------------------------=======(
class Game_Interpreter
  
  # )--------------------------------------------------------------------------(
  # )-- New Method: save_game                                                --(
  # )--------------------------------------------------------------------------(
  def save_game
    DataManager::save_game($game_system.get_save_index)
  end
end

# )=======---------------------------------------------------------------------(
# )-- Class: Game_System                                                     --(
# )---------------------------------------------------------------------=======(
class Game_System
  alias :mrts_rssy_gs_initialize :initialize
  
  # )--------------------------------------------------------------------------(
  # )-- Aliased Method: intialize                                            --(
  # )--------------------------------------------------------------------------(
  def initialize
    mrts_rssy_gs_initialize
    @save_file = DataManager.get_empty_save
  end
  
  # )--------------------------------------------------------------------------(
  # )-- New Method: get_save_index                                           --(
  # )--------------------------------------------------------------------------(
  def get_save_index
    @save_file
  end
end

# )=======---------------------------------------------------------------------(
# )-- Module: DataManager                                                    --(
# )---------------------------------------------------------------------=======(
module DataManager
  
  # )--------------------------------------------------------------------------(
  # )-- Overwritten Method: savefile_max                                     --(
  # )--------------------------------------------------------------------------(
  def self.savefile_max
    get_existant_saves.size
  end
  
  # )--------------------------------------------------------------------------(
  # )-- New Method: get_existant_saves                                       --(
  # )--------------------------------------------------------------------------(
  def self.get_existant_saves
    Dir.glob("Save*.rvdata2")
  end
  
  # )--------------------------------------------------------------------------(
  # )-- Overwritten Method: make_filename                                    --(
  # )--------------------------------------------------------------------------(
  def self.make_filename(index)
    sprintf("Save%d.rvdata2", index)
  end
  
  class << self
    alias :mrts_rss_dm_load_header :load_header
    alias :mrts_rss_dm_load_game :load_game
    
    # )------------------------------------------------------------------------(
    # )-- Aliased Method: load_header                                        --(
    # )------------------------------------------------------------------------(
    def load_header(index)
      index = get_existant_saves[index] =~ /Save(\d+)\.rvdata2/ ? $1.to_i : nil
      mrts_rss_dm_load_header(index)
    end
    
    # )------------------------------------------------------------------------(
    # )-- Aliased Method: load_game                                          --(
    # )------------------------------------------------------------------------(
    def load_game(index)
      index = get_existant_saves[index] =~ /Save(\d+)\.rvdata2/ ? $1.to_i : nil
      mrts_rss_dm_load_game(index)
    end
  end
  
  # )--------------------------------------------------------------------------(
  # )-- New Method: get_empty_save                                           --(
  # )--------------------------------------------------------------------------(
  def self.get_empty_save
    get_existant_saves[savefile_max-1] =~ /Save(\d+)\.rvdata2/ ? $1.to_i+1 : 1
  end
end

# )=======---------------------------------------------------------------------(
# )-- Class: Scene_Menu                                                      --(
# )---------------------------------------------------------------------=======(
class Scene_Menu < Scene_MenuBase
  
  # )--------------------------------------------------------------------------(
  # )-- Overwritten Method: command_save                                     --(
  # )--------------------------------------------------------------------------(
  def command_save
    DataManager::save_game($game_system.get_save_index)
    return_scene
  end
end 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Glad could help! =]

 

Also... since the script above auto-saves to the specific slot during your game, I added a message at the beginning of my game to choose a SAVE slot: Save 1, Save 2 or Save 3.

 

The player will choose their SAVE slot, and I created a Switch depending on the one they chose. That Switch is then at each Save Point/Event and will auto save to that slot for the duration of the game. That's their game's permanent save slot, unless they choose to start over.

 

For those of you interested in using this.

Fun fact - I wanted to tell you that, you can do such a thing, but I was sure you'll figure it out by yourself. =D

 

Yeah, autosave (forced save) is important in these games.

Personally when there are choices and I realize, that I picked something wrong, then I'm loading my game... So... That'll be a good way to prevent me from doing this. =P

Good luck with your project!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted