[RMVX] AUTOSAVE GAME IT IS POSSIBLE?

Posts

Pages: 1
Hi community. I do not post a lot, sorry that my first post is a requesting like this...



I would like to know if there exists or is possible an autosave script for RPG Maker VX (RGSS2). 



What a mean is, the possibility to save the game using triggers of any kind instead do manual saving (menu > save game).



I'm not sure if this is possible, but i would like to find a way that the maker saves the game automacttly without in determinates moments.



Thanks in adavance and Regards
Marrend
Guardian of the Description Thread
21781
I don't have access to VX anymore, so, I can't look up how to go about it. However, I definitely feel like it's possible to both create a system by which the game saves at whatever point(s) you specify (probably via a Common Event call?), and to remove "Save" from the menu (if that's also a thing you want).
Marrend, hello. Thanks for you answer.

Save the data from a common event call would be pretty great. In a first instance, my idea was (in case a script exists) to save the first 3 slots of saving menu (or at least the slot 1) to uses it as "autosave slots", and the rest of the slots to make just the manual saving.

At this last point, it is not neccesary that the autosave slots been blocked, if the player would like to manual overwrite, it's ok. I would not need a super estrict level of restrictions.

But no hurries! Thank you again for you attention.

Regards
author=xsebax
Marrend, hello. Thanks for you answer.

Save the data from a common event call would be pretty great. In a first instance, my idea was (in case a script exists) to save the first 3 slots of saving menu (or at least the slot 1) to uses it as "autosave slots", and the rest of the slots to make just the manual saving.

At this last point, it is not neccesary that the autosave slots been blocked, if the player would like to manual overwrite, it's ok. I would not need a super estrict level of restrictions.

But no hurries! Thank you again for you attention.

Regards


Hmm, I have used VX long time ago, but right now I am using MV. It works similarly, but of course with different language.

With MV you have an event command to open save menu like with VX. However, there is also corresponding javascript command withing the script of the game that actually runs when you use rpg maker interface. I would imagine somewhere within VX RGSS2 there is one there somewhere
This is a lot easier in VX ace and later, where the save file logic is separated from the save game UI.

Let's look at "Scene_File", which is the load/save game UI.
def do_save
    file = File.open(@savefile_windows[@index].filename, "wb")
    write_save_data(file)
    file.close
    return_scene
  end

That's the function which is called when you confirm a save.
It opens a file, calls a function to write the save data to the open file, then closes the file.

You don't want to create file windows for an autosave, but the filename generation is another function in Scene_File:
#--------------------------------------------------------------------------
  # * Create Filename
  #     file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end

So, what you need is a function which calls these functions...
# Auto save
#
# Saves the game in slot pointed to by a variable

# Game variable to autosave in
VARIABLE_SAVE_SLOT = 1

def auto_save()
  scene = Scene_File.new(true, false, true)
  filename = scene.make_filename($game_variables[VARIABLE_SAVE_SLOT])
  file = File.open(filename, "wb")
  scene.write_save_data(file)
  file.close
  # The scene is never started, just called functions from it.
end

Then you can call it from an event using "
auto_save
" in a script call command.
You can put this in a common event, to do any audio/visual notification of the auto save at the same time.

For VXace, you don't need any script, just use "
DataManager.save_game($game_variables[1])
" to auto save in the slot pointed to by variable 1.
Pages: 1