RPGVX Force Save

Started by Fishtales, April 08, 2013, 01:01:07 pm

Previous topic - Next topic

Fishtales

I've looked for quite some time trying to find a script for VX not Ace. Made the sad mistake of getting VX when it came out. -_-

Anyway If anyone could create a simple small script that allows me to force the game to save by calling it in an event and not just opening up the save screen, Almost similar to an autosave. I found one on this forum but it doesn't seem to work or i'm just that bad at getting it to work.

http://forum.chaos-project.com/index.php?topic=3177.0  Link to Post

Thank you for your time =3

BetaGod

April 10, 2013, 09:59:03 pm #1 Last Edit: April 10, 2013, 10:07:57 pm by BetaGod
That script seems to be fine for me. Do you mind to explain why it isn't working for you?

EDIT:

I am sure you are not using it in the right way. Create a new script over Main (press F11 first to open the window... At least i think it was F11, not sure)

Copy and paste this into the new blank script:
Spoiler: ShowHide
class Scene_Save
  def self.save(file_index)
    save_obj = self.new
    file = File.open(save_obj.make_filename(file_index), "wb")
    save_obj.write_save_data(file)
    file.close
  end
end


And then, in wichever event you need the script to autosave your file, use a Script Call command with the following syntax:

Scene_Save.save(slot)


Instead of the "slot" word, use an integer value (number) such as 1,2,3, etc. Where that value is the slot you want the game to be saved into.

For example, if you want to replace the saved slot number 0 (the first one, counting from the top) just before the boss fight; place a Call Script command right before the Battle Processing line with the following text:

Scene_Save.save(0)


Simple as that. Let me know if it is still not working.
I am a god in BETA status and therefore, i may contain bugs and such.

LiTTleDRAgo

I don't think VX have Scene_Save

BetaGod

April 10, 2013, 10:27:47 pm #3 Last Edit: April 10, 2013, 10:34:39 pm by BetaGod
Well i am not sure either. Anyway, i found a couple that may actually work:

This, or this, or even this.

I am a god in BETA status and therefore, i may contain bugs and such.

LiTTleDRAgo

April 10, 2013, 10:37:23 pm #4 Last Edit: April 10, 2013, 10:41:52 pm by LiTTleDRAgo
Quote from: BetaGod on April 10, 2013, 09:59:03 pm
Spoiler: ShowHide

That script seems to be fine for me. Do you mind to explain why it isn't working for you?

EDIT:

I am sure you are not using it in the right way. Create a new script over Main (press F11 first to open the window... At least i think it was F11, not sure)

Copy and paste this into the new blank script:
class Scene_Save
 def self.save(file_index)
   save_obj = self.new
   file = File.open(save_obj.make_filename(file_index), "wb")
   save_obj.write_save_data(file)
   file.close
 end
end


And then, in wichever event you need the script to autosave your file, use a Script Call command with the following syntax:

Scene_Save.save(slot)


Instead of the "slot" word, use an integer value (number) such as 1,2,3, etc. Where that value is the slot you want the game to be saved into.

For example, if you want to replace the saved slot number 0 (the first one, counting from the top) just before the boss fight; place a Call Script command right before the Battle Processing line with the following text:

Scene_Save.save(0)


Simple as that. Let me know if it is still not working.


I modified the code above to work into VX

class Scene_Save
  def self.save(index)
    save_obj = [Scene_File.new(true,false,true)].each {|s|
      [s.create_savefile_windows, s.dispose_item_windows, s.latest_file_index]
      [s.instance_variable_set(:@index, index),  s.do_save]}
  end
end


to use, add this into call script command :

Scene_Save.save(slot)

Scene_Save.save(0)


Fishtales

Thank you guys so very much! I appreciate all the help!