Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Fishtales on April 08, 2013, 01:01:07 pm

Title: RPGVX Force Save
Post by: Fishtales on April 08, 2013, 01:01:07 pm
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 (http://forum.chaos-project.com/index.php?topic=3177.0)  Link to Post

Thank you for your time =3
Title: Re: RPGVX Force Save
Post by: BetaGod on April 10, 2013, 09:59:03 pm
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.
Title: Re: RPGVX Force Save
Post by: LiTTleDRAgo on April 10, 2013, 10:18:51 pm
I don't think VX have Scene_Save
Title: Re: RPGVX Force Save
Post by: BetaGod on April 10, 2013, 10:27:47 pm
Well i am not sure either. Anyway, i found a couple that may actually work:

This (http://rmrk.net/index.php?topic=33752.0), or this (http://www.rpgmakervx.net/index.php?showtopic=1842&st=0&p=22999&#entry22999), or even this. (http://www.rpgmakervx.net/index.php?showtopic=5875&st=0&p=61523&#entry61523)

Title: Re: RPGVX Force Save
Post by: LiTTleDRAgo on April 10, 2013, 10:37:23 pm
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)

Title: Re: RPGVX Force Save
Post by: Fishtales on May 20, 2013, 03:54:27 pm
Thank you guys so very much! I appreciate all the help!