Current Version: 0.1
This is my try to "recreate" savestates like the behave on emulators (such as Dolphin, DeSmuME ... )
What does the script do?
You can save quickly without accessing the annoying save menu. In addition to that you can have up to 10 savefiles now (one regular+9 extra savefiles).
How can I save/load a stage?
save: SHIFT + 1-9
load: 1-9
How to get this script:
2.create a new script section above Main and paste this code in it:
Make sure to go to Thread Tools-->Show Printable version
Where will the savefiles be saved?
You can find them in the Data/Savestates folder. Your "normal" Savefile will still be located as the same Spot as before.
Will you update the script?
I give my best to try to add spots where you can save too.
Where can I save in this version?
- On the Map
Are there any settings in the Script?
SAVESTATES: When true you are able to savestate when false this script is disabled.
[I]ALLOW_SAVESTATES_ONLY_IN_DEBUG_MODE: When true you are only able to savestate in the Debug mode. When false you are able to savestate anywhere.[/I]
Where can I contact you?
Skype: imatrix.wt ;Deviantart: shiney570 ;PokeCom: shiney570
Thanks FL for helping me! Give credits to him too when using!
![[PokeCommunity.com] Advanced Quicksave for Essentials (Savestate Try) [PokeCommunity.com] Advanced Quicksave for Essentials (Savestate Try)](https://fs1.directupload.net/images/150619/5fei9mpr.png)
![[PokeCommunity.com] Advanced Quicksave for Essentials (Savestate Try) [PokeCommunity.com] Advanced Quicksave for Essentials (Savestate Try)](https://fs2.directupload.net/images/150619/zpf4smzp.png)
This is my try to "recreate" savestates like the behave on emulators (such as Dolphin, DeSmuME ... )
What does the script do?
You can save quickly without accessing the annoying save menu. In addition to that you can have up to 10 savefiles now (one regular+9 extra savefiles).
How can I save/load a stage?
save: SHIFT + 1-9
load: 1-9
How to get this script:
2.create a new script section above Main and paste this code in it:
Make sure to go to Thread Tools-->Show Printable version
Code:
#===============================================================================
# * Emulator Savestate Script for Pokémon Essentials v0.1
#
# - Save a Savestate with the Button's SHIFT + 1-9.
# - Load a Savestate with the Button's 1-9.
#
# Have any bugs/questions/suggestions?
# - Contact me! ( Skype: imatrix.wt ;Deviantart: shiney570 ;PokeCom: shiney570)
#
# Whenever you use don't forget to give credits. Also credit FL because he
# helped me a lot with things I didn't know!
#===============================================================================
SAVESTATES = true
ALLOW_SAVESTATES_ONLY_IN_DEBUG_MODE = true
#===============================================================================
# * Updating the Inputs.
#===============================================================================
class Scene_Map
def main
createSpritesets
Graphics.transition
loop do
Graphics.update
Input.update
update
if SAVESTATES
update_savestates
end
if ($saveStateFrameCount && SAVESTATES )
$saveStateFrameCount+=1
if $saveStateFrameCount>=80
$saveStateBitmap.bitmap.clear
$saveStateFrameCount=nil
end
end
if $scene != self
break
end
end
Graphics.freeze
disposeSpritesets
if $game_temp.to_title
Graphics.transition
Graphics.freeze
end
end
end
#===============================================================================
# * Method for Updating Savestates
#===============================================================================
def update_savestates
if $DEBUG || (!$DEBUG && (!ALLOW_SAVESTATES_ONLY_IN_DEBUG_MODE))
sub=30
for i in 1..9
if Input.press?(sub+i)
if !$saveStateBitmap
$saveStateBitmap=BitmapSprite.new(DEFAULTSCREENWIDTH,100)
$saveStateBitmap.z=99999999
$saveStateBitmap.bitmap.font.name="Arial"
$saveStateBitmap.bitmap.font.size=25
end
if Input.press?(Input::SHIFT)
pbSaveStage("#{i}")
else
pbLoadStage("#{i}")
end
end
end
end
end
#==================================================================================
# * Save Stages.
#=================================================================================
def pbSaveStage(slot)
# Creates Savestate folder if it doesn't exists yet.
if !(safeExists?("Data/Savestates"))
Dir.mkdir("Data/Savestates")
end
@savefile="Data/Savestates/savestate#{slot}.rxdata"
# Saving Stage.
File.open((@savefile),"wb") {|f|
Marshal.dump($Trainer,f)
Marshal.dump(Graphics.frame_count,f)
if $data_system.respond_to?("magic_number")
$game_system.magic_number = $data_system.magic_number
else
$game_system.magic_number = $data_system.version_id
end
Marshal.dump($game_system,f)
Marshal.dump($PokemonSystem,f)
Marshal.dump($game_map.map_id,f)
Marshal.dump($game_switches,f)
Marshal.dump($game_variables,f)
Marshal.dump($game_self_switches,f)
Marshal.dump($game_screen,f)
Marshal.dump($MapFactory,f)
Marshal.dump($game_player,f)
Marshal.dump($PokemonGlobal,f)
Marshal.dump($PokemonMap,f)
Marshal.dump($PokemonBag,f)
Marshal.dump($PokemonStorage,f)
}
$saveStage=slot
Graphics.frame_reset
printSavestateMessage("Saved State to Slot #{slot}.")
end
#==================================================================================
# * Load Stages.
#=================================================================================
def pbLoadStage(slot)
@savefile="Data/Savestates/savestate#{slot}.rxdata"
if !(safeExists?(@savefile))
printSavestateMessage("Savestate from Slot #{slot} was not found.")
return
end
File.open(@savefile){|f|
Marshal.load(f) # Trainer already loaded
Graphics.frame_count = Marshal.load(f)
$game_system = Marshal.load(f)
Marshal.load(f) # PokemonSystem already loaded
Marshal.load(f) # Current map id no longer needed
$game_switches = Marshal.load(f)
$game_variables = Marshal.load(f)
$game_self_switches = Marshal.load(f)
$game_screen = Marshal.load(f)
$MapFactory = Marshal.load(f)
$game_map = $MapFactory.map
$game_player = Marshal.load(f)
$PokemonGlobal = Marshal.load(f)
metadata = Marshal.load(f)
$ItemData = readItemList("Data/items.dat")
$PokemonBag = Marshal.load(f)
$PokemonStorage = Marshal.load(f)
magicNumberMatches=false
$PokemonMap=metadata
if $data_system.respond_to?("magic_number")
magicNumberMatches=($game_system.magic_number==$data_system.magic_number)
else
magicNumberMatches=($game_system.magic_number==$data_system.version_id)
end
if !magicNumberMatches || $PokemonGlobal.safesave
if pbMapInterpreterRunning?
pbMapInterpreter.setup(nil,0)
end
begin
$MapFactory.setup($game_map.map_id) # calls setMapChanged
rescue Errno::ENOENT
if $DEBUG
printSavestateMessage("Map #{$game_map.map_id} was not found.")
map=pbWarpToMap()
if map
$MapFactory.setup(map[0])
$game_player.moveto(map[1],map[2])
else
$game_map=nil
$scene=nil
return
end
else
printSavestateMessage("The map was not found. The game cannot continue.")
end
end
$game_player.center($game_player.x, $game_player.y)
else
$MapFactory.setMapChanged($game_map.map_id)
end
}
if !$game_map.events # Map wasn't set up
printSavestateMessage("The map is corrupt. The game cannot continue.")
return
end
$loadStage=slot
$PokemonEncounters=PokemonEncounters.new
$PokemonEncounters.setup($game_map.map_id)
pbAutoplayOnSave
$game_map.update
$PokemonMap.updateMap
$scene = Scene_Map.new
printSavestateMessage("Loaded State from Slot #{slot}.")
end
#===============================================================================
# * Printing Message.
#===============================================================================
def printSavestateMessage(message)
$saveStateBitmap.bitmap.clear
textos=[]
textos.push([message,5,5,false,Color.new(254,254,76),Color.new(35,35,35)])
pbDrawTextPositions($saveStateBitmap.bitmap,textos)
$saveStateFrameCount=0
end
#===============================================================================
# * defineing inputs 1-9.
#===============================================================================
module Input
NUMBER0 = 30
NUMBER1 = 31
NUMBER2 = 32
NUMBER3 = 33
NUMBER4 = 34
NUMBER5 = 35
NUMBER6 = 36
NUMBER7 = 37
NUMBER8 = 38
NUMBER9 = 39
class << self
alias old_self_button_to_key_shiney_123 :buttonToKey
end
def self.buttonToKey(button)
case button
when Input::NUMBER0
return [0x30] # 0
when Input::NUMBER1
return [0x31] # 1
when Input::NUMBER2
return [0x32] # 2
when Input::NUMBER3
return [0x33] # 3
when Input::NUMBER4
return [0x34] # 4
when Input::NUMBER5
return [0x35] # 5
when Input::NUMBER6
return [0x36] # 6
when Input::NUMBER7
return [0x37] # 7
when Input::NUMBER8
return [0x38] # 8
when Input::NUMBER9
return [0x39] # 9
end
self.old_self_button_to_key_shiney_123(button)
end
end
Where will the savefiles be saved?
You can find them in the Data/Savestates folder. Your "normal" Savefile will still be located as the same Spot as before.
Will you update the script?
I give my best to try to add spots where you can save too.
Where can I save in this version?
- On the Map
Are there any settings in the Script?
SAVESTATES: When true you are able to savestate when false this script is disabled.
[I]ALLOW_SAVESTATES_ONLY_IN_DEBUG_MODE: When true you are only able to savestate in the Debug mode. When false you are able to savestate anywhere.[/I]
Where can I contact you?
Skype: imatrix.wt ;Deviantart: shiney570 ;PokeCom: shiney570
Thanks FL for helping me! Give credits to him too when using!
Last edited: