[RMXP] IS THERE A LOAD AND SAVE FILE SCRIPT CALL?

Posts

Pages: 1
I'm doing a game where after the title screen appears (Wich is actually a map, I have a skip Title Screen script) and I need a script call wich can load a especific save file AND another wich can save in a specific save file, please help me if there's a script call or script that does both
I tried it, but I have a script that skis title and you have to place it in scene_title so It allways fails
Marrend
Guardian of the Description Thread
21806
I don't have access to XP anymore, but, my guess is that the functions to load, or save, would be in classes like Scene_Load, or Scene_Save. Or whatever XP actually uses!
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
They were, Marrend was correct. I just copied and pasted some lines from Scene_Load and Scene_Save to a script call and they worked fine.



This script call will load the save file in slot 1:

filename = "Save1.rxdata"
if FileTest.exist?(filename)
  file = File.open(filename, "rb")
  read_save_data(file)
  file.close
  $scene = Scene_Map.new
end


This script call will save the current game to slot 1:

filename = "Save1.rxdata"
file = File.open(filename, "wb")
save_scene = Scene_Save.new
save_scene.write_save_data(file)
file.close

In both cases you can change the filename to anything you want. If you want, you can use a non-standard filename instead of Save1 through Save4. Doing so will mean that the save file won't appear on the standard Save/Load screens, which might be useful if it's some kind of system file that you don't want the player to overwrite.
Need to be rxdata, or cant be other format?
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
You can call the file whatever extension you want.
Pages: 1