Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Single Save
- # Last Date Updated: 2010.05.17
- # Level: Easy
- #
- # Some games benefit more by having one save instead of multiple. This script
- # makes it so that saving will save to only one slot and loading will only
- # load from one slot.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #
- # Note: Using the call save menu event from the event editor will automatically
- # save, and not bring up the save menu.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["SingleSave"] = true
- #==============================================================================
- # ** Scene_File
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- def start
- super
- if @saving
- do_save
- else
- do_load
- end
- end
- #--------------------------------------------------------------------------
- # * Execute Transition
- #--------------------------------------------------------------------------
- def perform_transition
- unless @saving
- Graphics.transition(10)
- end
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- def terminate
- super
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- end
- #--------------------------------------------------------------------------
- # * Execute Save
- #--------------------------------------------------------------------------
- def do_save
- file = File.open(make_filename(0), "wb")
- write_save_data(file)
- file.close
- return_scene
- Sound.play_save
- end
- #--------------------------------------------------------------------------
- # * Execute Load
- #--------------------------------------------------------------------------
- def do_load
- file = File.open(make_filename(0), "rb")
- read_save_data(file)
- file.close
- $scene = Scene_Map.new
- RPG::BGM.fade(1500)
- Graphics.fadeout(20)
- Graphics.wait(20)
- @last_bgm.play
- @last_bgs.play
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment