- 1,224
- Posts
- 11
- Years
- Omnipresence
- Seen Aug 8, 2023
Okay, completely revamped this. It looks a lot nicer and makes a lot more sense. Supports virtually unlimited save files (which is not recommended, but it can do a very large amount, albeit taking longer the more save files). Nice slidy menus. Can choose to load your regular save file, or autosave file if you have one (for use with my autosave function, won't effect performance or cause crashes if you don't have autosaves though, it just checks to see if you have them). When choosing these, the last modified date/time is displayed, so you can choose the newer one or whatever. In menu option to delete the currently loaded save file (have to confirm two serious confirms, so you shouldn't accidentally do it).
Most importantly, when you choose a save file it reloads the Load menu with the chosen save file, so it shows the party and location, etc. That way you know which save file you're actually loading.
Note, when looking for files, it will skip up to two before quitting. For example, if you have only Game_2 and Game_5 files, it will find both of them, but if you have Game_2 and Game_6, it will not look for Game_6. This can be changed, I just figured two was a decent amount and I had to pick something.
Should work for v13+
This script uses game_variables[99] to determine which slot it should save in in-game. So keep that variable open or change all the instances in these to whatever variable you want.
Replace PokemonLoad with this (PScreen_Load in v15)
PokemonLoad
If using v13, replace line 309 here with
Replace PokemonSave with this (PScreen_Save in v15)
PokemonSave
Replace PokemonSystem with this (I only changed a few lines, but I'd rather not walk people through bugs and it's a short section)
(PSystem_System in v15)
PokemonSystem
You need the attatched graphics, put them in your Pictures folder.
When you start a new game, it finds the next available game slot for you. Also removed the begunNewGame part of PokemonSave, because it doesn't really make sense with this.
Replace Main with this (I've highlighted the added code in red, if you've made changes
And finally replace these two defs in Scene_Intro (closeSplash, and closeSplashDelete)
Please give credit if you use it.
Removed security features, they did more harm than good. Fixed it so that when changing between save files, it resizes the screen if you have them set differently (large on one file, medium on another). Automatically stores the last accessed file to a separate data file, to read and load the last accessed game on start-up
Most importantly, when you choose a save file it reloads the Load menu with the chosen save file, so it shows the party and location, etc. That way you know which save file you're actually loading.
Note, when looking for files, it will skip up to two before quitting. For example, if you have only Game_2 and Game_5 files, it will find both of them, but if you have Game_2 and Game_6, it will not look for Game_6. This can be changed, I just figured two was a decent amount and I had to pick something.
Should work for v13+
This script uses game_variables[99] to determine which slot it should save in in-game. So keep that variable open or change all the instances in these to whatever variable you want.
Replace PokemonLoad with this (PScreen_Load in v15)
PokemonLoad
If using v13, replace line 309 here with
Spoiler:
Code:
@sprites["player"]=IconSprite.new(64,64,@viewport)
@sprites["player"].setBitmap("Graphics/Characters/"+filename)
Replace PokemonSave with this (PScreen_Save in v15)
PokemonSave
Replace PokemonSystem with this (I only changed a few lines, but I'd rather not walk people through bugs and it's a short section)
(PSystem_System in v15)
PokemonSystem
You need the attatched graphics, put them in your Pictures folder.
When you start a new game, it finds the next available game slot for you. Also removed the begunNewGame part of PokemonSave, because it doesn't really make sense with this.
Replace Main with this (I've highlighted the added code in red, if you've made changes
Spoiler:
Code:
class Scene_DebugIntro
def main
Graphics.transition(0)
[COLOR="red"] if File.exists?("Data/LastSave.dat")
lastsave=pbGetLastPlayed
if lastsave[1].to_s=="true"
if lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game_autosave.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}_autosave.rxdata")
end
elsif lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}.rxdata")
end
lastsave[1]=nil if lastsave[1]!="true"
if safeExists?(savefile)
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen(lastsave[0].to_i,lastsave[1],"Save File #{lastsave[0]}")
else
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
else[/COLOR]
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
[COLOR="red"]end[/COLOR]
Graphics.freeze
end
end
def pbCallTitle #:nodoc:
if $DEBUG
return Scene_DebugIntro.new
else
# First parameter is an array of images in the Titles
# directory without a file extension, to show before the
# actual title screen. Second parameter is the actual
# title screen filename, also in Titles with no extension.
return Scene_Intro.new(['intro1'], 'splash')
end
end
def mainFunction #:nodoc:
if $DEBUG
pbCriticalCode { mainFunctionDebug }
else
mainFunctionDebug
end
return 1
end
def mainFunctionDebug #:nodoc:
begin
getCurrentProcess=Win32API.new("kernel32.dll","GetCurrentProcess","","l")
setPriorityClass=Win32API.new("kernel32.dll","SetPriorityClass",%w(l i),"")
setPriorityClass.call(getCurrentProcess.call(),32768) # "Above normal" priority class
$data_animations = pbLoadRxData("Data/Animations")
$data_tilesets = pbLoadRxData("Data/Tilesets")
$data_common_events = pbLoadRxData("Data/CommonEvents")
$data_system = pbLoadRxData("Data/System")
$game_system = Game_System.new
setScreenBorderName("border") # Sets image file for the border
Graphics.update
Graphics.freeze
$scene = pbCallTitle
while $scene != nil
$scene.main
end
Graphics.transition(20)
rescue Hangup
pbEmergencySave
raise
end
end
loop do
retval=mainFunction
if retval==0 # failed
loop do
Graphics.update
end
elsif retval==1 # ended successfully
break
end
end
And finally replace these two defs in Scene_Intro (closeSplash, and closeSplashDelete)
Spoiler:
Code:
def closeSplash(scene,args)
onCTrigger.clear
onUpdate.clear
# Play random cry
cry=pbResolveAudioSE(pbCryFile(1+rand(PBSpecies.maxValue)))
pbSEPlay(cry,100,100) if cry
# Fade out
@pic.moveOpacity(15,0,0)
@pic2.moveOpacity(15,0,0)
pbBGMStop(1.0)
pictureWait
scene.dispose # Close the scene
Graphics.transition(0)
if File.exists?("Data/LastSave.dat")
lastsave=pbGetLastPlayed
lastsave[0]=lastsave[0].to_i
if lastsave[1].to_s=="true"
if lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game_autosave.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}_autosave.rxdata")
end
elsif lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}.rxdata")
end
lastsave[1]=nil if lastsave[1]!="true"
if safeExists?(savefile)
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen(lastsave[0].to_i,lastsave[1],"Save File #{lastsave[0]}")
else
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
else
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
end
def closeSplashDelete(scene,args)
onCTrigger.clear
onUpdate.clear
# Play random cry
cry=pbResolveAudioSE(pbCryFile(1+rand(PBSpecies.maxValue)))
pbSEPlay(cry,100,100) if cry
# Fade out
@pic.moveOpacity(15,0,0)
@pic2.moveOpacity(15,0,0)
pbBGMStop(1.0)
pictureWait
scene.dispose # Close the scene
Graphics.transition(0)
if File.exists?("Data/LastSave.dat")
lastsave=pbGetLastPlayed
lastsave[0]=lastsave[0].to_i
if lastsave[1].to_s=="true"
if lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game_autosave.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}_autosave.rxdata")
end
elsif lastsave[0]==0 || lastsave[0]==1
savefile=RTP.getSaveFileName("Game.rxdata")
else
savefile = RTP.getSaveFileName("Game_#{lastsave[0]}.rxdata")
end
lastsave[1]=nil if lastsave[1]!="true"
if safeExists?(savefile)
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen(lastsave[0].to_i,lastsave[1],"Save File #{lastsave[0]}")
else
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
else
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
end
end
Please give credit if you use it.
Removed security features, they did more harm than good. Fixed it so that when changing between save files, it resizes the screen if you have them set differently (large on one file, medium on another). Automatically stores the last accessed file to a separate data file, to read and load the last accessed game on start-up
Attachments
Last edited: