+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Temporary Save Script (/thread-2728.html)
Temporary Save Script - Anonymous - 03-03-2008
Temporary Save Script
Script by ??? [posted on the anonymous Japanese BBS 2ch]
saved from Phylomortis.Com
Introduction
This script will return the player to the title screen after saving his or her game. When the player loads the saved file, it is immediately deleted. This creates an effect like Breath of Fire 5: Dragon Quarter, where players have to save strategically rather than just try a dangerous area over and over again by reloading a saved game.
Originally, oo use the script, replace method Scene_Save#on_decision with the first block of code, and replace the method Scene_Load#on_decision with the second block of code.
Now, the script has been lightly touched so you can just paste it ABOVE Main or BELOW Scene_Debug to use it.
Script
Plug and Play Version
Code:
# Temporary Save Script
# by anonymous
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# Play save SE
$game_system.se_play($data_system.save_se)
# Write save data
file = File.open(filename, "wb")
write_save_data(file)
file.close
$scene = Scene_Title.new
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# If file doesn't exist
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play load SE
$game_system.se_play($data_system.load_se)
# Read save data
file = File.open(filename, "rb")
read_save_data(file)
file.close
File.delete(filename)
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
end