Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Save Control
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Save_Con]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 21/o4/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # Simple Script to allow a little more control over your save files.
- # Allows you to change the filename and extension.
- # Also allows for the save files to be stored into a folder.
- #
- # This script also slightly modify's the save/load scene to provide
- # a little more information, ie level, name ..
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- module Deki_Save
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Save File Configuration
- #--------------------------------------------------------------------------
- # << Save File's Folder. "" = default game folder
- Folder = "Save_Data/"
- # << Save File's Name (will be followed by the file index
- FileName = "sD13x_21o42o13"
- # << Save File Extension. Can be .rvdata2, .sav or .txt (reccommend .rvdata2)
- File_Ext = ".rvdata2"
- # << Max Save Files Allowed
- Max_Files = 12
- # << Allow save/load scene to be modified slightly ?
- Modify_Scene = true
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- module Deki_Save
- #===============================================================================
- Dir.mkdir(Folder) unless Dir.exist?(Folder)
- case File_Ext;when".rvdata2",".sav",".txt";else;File_Ext=".rvdata2";end
- #-----------------------------------------------------------------------------
- # Determine Existence of Save File
- #-----------------------------------------------------------------------------
- def self.save_file_exists?
- !Dir.glob("#{Folder}#{FileName}*#{File_Ext}").empty?
- end
- #-----------------------------------------------------------------------------
- # Create Filename | index : File Index
- #-----------------------------------------------------------------------------
- def self.make_filename(index)
- "#{Folder}#{FileName}#{index+1}#{File_Ext}"
- end
- end
- #===============================================================================
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Determine Existence of Save File
- #-----------------------------------------------------------------------------
- def self.save_file_exists?
- Deki_Save.save_file_exists?
- end
- #-----------------------------------------------------------------------------
- # Maximum Number of Save Files
- #-----------------------------------------------------------------------------
- def self.savefile_max
- return Deki_Save::Max_Files
- end
- #-----------------------------------------------------------------------------
- # Create Filename | index : File Index
- #-----------------------------------------------------------------------------
- def self.make_filename(index)
- Deki_Save.make_filename(index)
- end
- end
- if Deki_Save::Modify_Scene
- #===============================================================================
- module DataManager
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- class << self
- alias :msh_dekisav :make_save_header
- end
- #-----------------------------------------------------------------------------
- # Make Save Header
- #-----------------------------------------------------------------------------
- def self.make_save_header
- header = msh_dekisav
- header[:cash] = $game_party.gold
- header
- end
- end
- #===============================================================================
- class Game_Party < Game_Unit
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Character Information for Save File Display
- #-----------------------------------------------------------------------------
- def characters_for_savefile
- battle_members.collect do |actor|
- [actor.character_name, actor.character_index,
- actor.name, actor.level]
- end
- end
- end
- #===============================================================================
- class Window_SaveFile < Window_Base
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Refresh
- #-----------------------------------------------------------------------------
- def refresh
- contents.clear
- refresh_the_font
- draw_save_file_info
- end
- #-----------------------------------------------------------------------------
- # Refresh Font Settings
- #-----------------------------------------------------------------------------
- def refresh_the_font
- if !General::Fonts.include?(self.contents.font.name)
- self.contents.font.name = General::Fonts
- end
- if self.contents.font.size != General::Font_Size
- self.contents.font.size = General::Font_Size
- end
- if self.contents.font.bold != General::Font_Bold
- self.contents.font.bold = General::Font_Bold
- end
- end
- #-----------------------------------------------------------------------------
- # Draw Save Info
- #-----------------------------------------------------------------------------
- def draw_save_file_info
- font_size_mod = 2
- header = DataManager.load_header(@file_index)
- change_color(normal_color)
- name = Vocab::File + " #{@file_index + 1}"
- self.contents.font.size += font_size_mod
- draw_text(4, 0, 200, line_height, name)
- @name_width = text_size(name).width
- draw_cash(0, 0, contents.width, header, 1)
- draw_playtime(0, 0, contents.width, header, 2)
- self.contents.font.size -= font_size_mod
- draw_party_characters(24,48,header)
- end
- #-----------------------------------------------------------------------------
- # Draw Party Characters
- #-----------------------------------------------------------------------------
- def draw_party_characters(x, y, header)
- return unless header
- header[:characters].each_with_index do |data, i|
- draw_bio_block(x,y,i,data)
- end
- end
- #-----------------------------------------------------------------------------
- # Draw Actor Bio
- #-----------------------------------------------------------------------------
- def draw_bio_block(x,y,i,data)
- nx = x + ((contents.width-x/2)/$game_party.max_battle_members*i)
- draw_character(data[0], data[1], nx, y+18)
- draw_text(nx+18, y-18, 98, line_height, data[2], 0)
- draw_text(nx+18, y , 98, line_height, "Lvl: #{data[3]}", 0)
- end
- #-----------------------------------------------------------------------------
- # Draw Play Time
- #-----------------------------------------------------------------------------
- def draw_playtime(x, y, width, header, align)
- return unless header
- draw_text(x, y, width, line_height, "Playtime: " + header[:playtime_s], align)
- end
- #-----------------------------------------------------------------------------
- # Draw Cash
- #-----------------------------------------------------------------------------
- def draw_cash(x, y, width, header, align)
- return unless header
- draw_text(x, y, width, line_height, "Gold: " + header[:cash].to_s, align)
- end
- end
- #===============================================================================
- class Scene_File < Scene_MenuBase
- #===============================================================================
- #-----------------------------------------------------------------------------
- # Alias List
- #-----------------------------------------------------------------------------
- alias :visimaxxsave :visible_max
- #-----------------------------------------------------------------------------
- # Get Number of Save Files to Show on Screen
- #-----------------------------------------------------------------------------
- def visible_max
- return Deki_Save::Max_Files if (Deki_Save::Max_Files < 4)
- return visimaxxsave
- end
- end
- end # if Deki_Save::Modify_Scene
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement