じ☆ve冰风 发表于 2026-7-27 16:49:55

Save File Output Control

Save File Output Control v.1.1

by Metatron



Introduction

This is a little script that allows you to change several settings related to your save files.It's my first real script!

Features

- Change the filename of your save files.

- Change the maximum number of save files available to your player.

- Gives you the ability to have more save files in Test Mode.

- Removes redundant numbers if you only allow for one save file.

- Allows easy edits to the save prompts.

Screenshots

Spoiler
https://dl.dropbox.com/s/yo9hd9p121u743l/2file.PNG



https://dl.dropbox.com/s/g702815ryuv0zlp/1file.PNG




How to Use

Just paste it in the Materials section above main and edit the module to your liking.Be warned that if you set SaveNum or TestNum too high, it will take a long time to create the save file window and may possibly crash your RGSS player.Also be warned that if you only have one file available to your player but more available in test mode, a save from test mode will not be read when $TEST is not on and vice-versa.I will fix this shortly.

Demo

Not nessecary.

Script

Spoiler                Code:       
#===============================================================================
# RGSS3: Save File Output Control v.1.1
#===============================================================================
# by Cryranos
#===============================================================================
# Instructions:Paste In the Materials section.Edit Module as desired.
#===============================================================================
# Compatability:Completely rewrites DataManager#self.save_file_exists?,
# self.savefile_max, self.make_filename(index), dself.load_game(index), and
# Window_SaveFile#refresh. Aliases Scene_File < Scene_MenuBase#visible_max.
#===============================================================================

module CrySave
SaveNum = 16                # Absolute maximum number of save files. Default: 16
SaveNom = "Save"        # First part of savefile name. Default: "Save"
SaveExt = ".rvdata2"# Extension of the savefile name. Default: ".rvdata2"
SaveVis = 4               # Number of savefiles visible on one screen. Default: 4
TestNum = 99                # Maximum number of save files available in test mode.
# If this number is too high, it will take a long time to load Window_SaveFile.
end

module Vocab
SaveMessage       = "Save to which file?"
LoadMessage       = "Load from which file?"
File                        = "Save"
end

class Save_File_Control_Output_Control
def DataManager.save_file_exists?
        if CrySave::SaveNum == 1
          !Dir.glob(CrySave::SaveNom + CrySave::SaveExt).empty?
        elsif $TEST
          !Dir.glob(CrySave::SaveNom + '*' + CrySave::SaveExt).empty?
        else
          !Dir.glob(CrySave::SaveNom + '*' + CrySave::SaveExt).empty?
        end
end

def DataManager.savefile_max
        if $TEST
          return CrySave::TestNum
        else
          return CrySave::SaveNum
        end
end

def DataManager.make_filename(index)
        if CrySave::SaveNum == 1
          sprintf(CrySave::SaveNom + CrySave::SaveExt, index + 1)
        elsif $TEST
          sprintf(CrySave::SaveNom + "%02d" + CrySave::SaveExt, index + 1)          
        else
          sprintf(CrySave::SaveNom + "%02d" + CrySave::SaveExt, index + 1)
        end
end

def DataManager.load_game(index)
        load_game_without_rescue(index) rescue false
end
end

class Window_SaveFile
def refresh
        contents.clear
        change_color(normal_color)
        if $TEST
          name = Vocab::File + " #{@file_index + 1}"
        elsif CrySave::SaveNum == 1
          name = Vocab::File
        else
          name = Vocab::File + " #{@file_index + 1}"
        end
        draw_text(4, 0, 200, line_height, name)
        @name_width = text_size(name).width
        draw_party_characters(152, 58)
        draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
end
end

class Scene_File < Scene_MenuBase
alias visible_max_new visible_max
def visible_max
        visible_max_new
        return CrySave::SaveVis
end
end





FAQ

None so far.

Credit and Thanks

- Cryranos/Metatron, author

- CaptainJet and Fomar0153


本贴来自国际rpgmaker官方论坛作者:Cryranos处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/save-file-output-control.2939/
页: [1]
查看完整版本: Save File Output Control