CODE
=begin
To do the resident evil thing you wanted
use the Common Event thing then put it in your item common event selection.
Single Save
From PocketWiki
Jump to: navigation, search
* Return to the VX Scripts
* Return to the Shanghai's Scripts
Contents
[hide]
* 1 Introduction
* 2 Instructions
* 3 Script Code
Single Save
Link Single Save
Last Update 2010.05.17
Author(s) Shanghai
$imported $imported["SingleSave"]
Terms of Usage
This script can be used for both non-commercial and commercial games. Credit does not need to be due for a Shanghai Simple Script as these are things that were created within less than an hour anyway.
Version History
2010.05.17 - Finished Script
Introduction
Some games benefit more by having a single save.
Instructions
Just put this into your script list anywhere and it should work.
Script Code
#===============================================================================
#
# 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.
#===============================================================================
=end
$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
class Scene_Menu
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # End Game
$scene = Scene_End.new
end
end
end
end
#===============================================================================
#
# END OF FILE
#
#===============================================================================
=begin
* Return to the VX Scripts
* Return to the Shanghai's Scripts
Retrieved from "http://wiki.pockethouse.com/index.php?title=Single_Save"
Categories: VX Scripts | Shanghai Simple Scripts
Views
* Page
* Discussion
* View source
* History
Personal tools
* Log in / create account
Navigation
* Main Page
* Community portal
* Current events
* Recent changes
* Random page
* Help
Search
Toolbox
* What links here
* Related changes
* Special pages
* Printable version
* Permanent link
Powered by MediaWiki
* This page was last modified on 17 May 2010, at 16:52.
* This page has been accessed 91 times.
* Privacy policy
* About PocketWiki
* Disclaimers
* Install MediaWiki
* web hosting
=end