- Joined
- Apr 17, 2013
- Messages
- 93
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- N/A
Hey. I recently got all of Moghunter's scripts (https://atelierrgss.wordpress.com/) from his Master Collection and amongst them was a super-fancy save script, which I will include below:
Moghunter's Script:
I will also include the necessary images for the script to work, obviously all credits still go to Moghunter (see the images at the bottom of the post).
Can we make it work in conjuction with the custom quick-save script that I have been using until now? It has mostly been made and edited my members on this forums per requests, so I doubt you will find it anywhere else on the net. I imagine it would be easier editing this script than it would be editing the above one:
Trying to use the quick-save now (by the time I installed moghunter's script I mean), I get the following error:
The referred line is the following:
Thanks for your time! If you have any questions, feel free to ask. The script will be used for my free-to-play Broken Reality, and credits will be given properly.
Moghunter's Script:
Code:
#==============================================================================
# +++ MOG - Scene File A (V1.3) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# Tela de salvar e carregar animado versão A.
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/System
#
# Save_Number.png
# Save_Background.png
# Save_Character_Floor.png
# Save_Layout01.png
# Save_Layout02.png
# Save_Window01.png
# Save_Window02.png
#
#==============================================================================
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.3 - Melhor codificação.
# v 1.1 - Melhoria no sistema de dispose de imagens.
#==============================================================================
module MOG_SCENE_FILE
#Quantidade de slots de saves.
FILES_MAX = 9
end
#==============================================================================
# ■ Game Temp
#==============================================================================
class Game_Temp
attr_accessor :scene_save
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_scene_file_initialize initialize
def initialize
mog_scene_file_initialize
@scene_save = false
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● draw_picture_number(x,y,value,file_name,align, space, frame_max ,frame_index)
#--------------------------------------------------------------------------
# X - Posição na horizontal
# Y - Posição na vertical
# VALUE - Valor Numérico
# FILE_NAME - Nome do arquivo
# ALIGN - Centralizar 0 - Esquerda 1- Centro 2 - Direita
# SPACE - Espaço entre os números.
# FRAME_MAX - Quantidade de quadros(Linhas) que a imagem vai ter.
# FRAME_INDEX - Definição do quadro a ser utilizado.
#--------------------------------------------------------------------------
def draw_picture_number(x,y,value, file_name,align = 0, space = 0, frame_max = 1,frame_index = 0)
number_image = Cache.system(file_name)
frame_max = 1 if frame_max < 1
frame_index = frame_max -1 if frame_index > frame_max -1
align = 2 if align > 2
cw = number_image.width / 10
ch = number_image.height / frame_max
h = ch * frame_index
number = value.abs.to_s.split(//)
case align
when 0
plus_x = (-cw + space) * number.size
when 1
plus_x = (-cw + space) * number.size
plus_x /= 2
when 2
plus_x = 0
end
for r in 0..number.size - 1
number_abs = number[r].to_i
number_rect = Rect.new(cw * number_abs, h, cw, ch)
self.contents.blt(plus_x + x + ((cw - space) * r), y , number_image, number_rect)
end
number_image.dispose
end
#--------------------------------------------------------------------------
# ● Draw Help Layout
#--------------------------------------------------------------------------
def draw_face_save(name,x,y,type)
if type == 0
image_name = name + "_0"
elsif type == 1
image_name = name + "_1"
else
image_name = name + "_2"
end
image = Cache.face(image_name)
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout
#--------------------------------------------------------------------------
def draw_parameter_layout(x,y)
image = Cache.system("Save_Window01")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_parameter_layout2
#--------------------------------------------------------------------------
def draw_parameter_layout2(x,y,type)
if type == 0
image = Cache.system("Save_Window02")
else
image = Cache.system("Save_Window03")
end
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
#--------------------------------------------------------------------------
# ● draw_character_floor
#--------------------------------------------------------------------------
def draw_character_floor(x,y)
image = Cache.system("Save_Character_Floor")
cw = image.width
ch = image.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y , image, src_rect)
image.dispose
end
end
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# ● Make Save Header
#--------------------------------------------------------------------------
def self.make_save_header
header = {}
header[:characters] = $game_party.characters_for_savefile
header[:playtime_s] = $game_system.playtime_s
header[:playtime] = $game_system.playtime
header[:map_name] = $game_map.display_name
header[:members] = $game_party.members
header
end
end
#==============================================================================
# ■ Window_SaveFile
#==============================================================================
class Window_SaveFile_A < Window_Base
attr_reader :filename
attr_reader :file_exist
attr_reader :time_stamp
attr_reader :selected
attr_reader :file_index
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(file_index, filename)
super(0, 0,720, 140)
self.opacity = 0
@file_index = file_index
@filename = filename
load_gamedata
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● load_gamedata
#--------------------------------------------------------------------------
def load_gamedata
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
header = DataManager.load_header(@file_index)
if header == nil
@file_exist = false
return
end
@characters = header[:characters]
@total_sec = header[:playtime]
@mapname = header[:map_name]
@members = header[:members]
end
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
xp = 96
ex = 60
if @file_exist
if @total_sec == nil
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(140, 50, 450, 32, "Error! - Please, dont't use your old Save Files...", 0)
return
end
draw_parameter_layout2(0,50,0)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
draw_party_characters(180 + xp, 75,ex)
draw_playtime(495, 20, contents.width - 4, 2)
draw_map_location( 400 + xp,64)
draw_level(185 + xp,85,ex)
draw_face_save(40 + xp,0)
else
draw_parameter_layout2(0,50,1)
draw_parameter_layout(-10 + xp,0)
value = @file_index + 1
draw_picture_number(13 + xp, 32,value, "Save_Number_01",1,0,3,0)
self.contents.draw_text(260, 50, 120, 32, "No Data", 1)
end
end
#--------------------------------------------------------------------------
# ● draw_face
#--------------------------------------------------------------------------
def draw_face_save(x,y)
draw_actor_face(@members[0], x, y)
end
#--------------------------------------------------------------------------
# ● draw_level
#--------------------------------------------------------------------------
def draw_level(x,y,ex)
self.contents.font.color = normal_color
for i in 0...@members.size
break if i > 3
level = @members[i].level
draw_picture_number(x + (ex * i) , y ,level, "Save_Number_01",1,0,3,1)
end
end
#--------------------------------------------------------------------------
# ● draw_map_location
#--------------------------------------------------------------------------
def draw_map_location(x,y)
self.contents.font.bold = true
self.contents.font.name = "Georgia"
self.contents.font.size = 20
self.contents.font.italic = true
self.contents.draw_text(x, y, 125, 32, @mapname.to_s, 0)
end
#--------------------------------------------------------------------------
# ● draw_party_characters
#--------------------------------------------------------------------------
def draw_party_characters(x, y,ex)
for i in 0...@characters.size
break if i > 3
name = @characters[i][0]
index = @characters[i][1]
draw_character_floor(- 35 + x + i * ex,y - 20)
draw_character(name, index, x + i * ex, y)
end
end
#--------------------------------------------------------------------------
# ● draw_playtime
#--------------------------------------------------------------------------
def draw_playtime(x, y, width, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
draw_picture_number(x + 18 * 0, y ,0, "Save_Number_01",0,0,3,0) if hour < 10
draw_picture_number(x + 18 * 1, y ,hour, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 3, y ,0, "Save_Number_01",0,0,3,0) if min < 10
draw_picture_number(x + 18 * 4, y ,min, "Save_Number_01",0,0,3,0)
draw_picture_number(x + 18 * 6, y ,0, "Save_Number_01",0,0,3,0) if sec < 10
draw_picture_number(x + 18 * 7, y ,sec , "Save_Number_01",0,0,3,0)
end
#--------------------------------------------------------------------------
# ● selected
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
end
end
#==============================================================================
# ■ Scene Save
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = true
super
end
end
#==============================================================================
# ■ Scene Load
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
$game_temp.scene_save = false
super
end
end
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File
include MOG_SCENE_FILE
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
@saving = $game_temp.scene_save
@file_max = FILES_MAX
@file_max = 1 if FILES_MAX < 1
execute_dispose
create_layout
create_savefile_windows
@index = DataManager.last_savefile_index
@check_prev_index = true
@savefile_windows[@index].selected = true
end
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.transition
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------
def execute_loop
loop do
Graphics.update
Input.update
update
if SceneManager.scene != self
break
end
end
end
#--------------------------------------------------------------------------
# ● Create_background
#--------------------------------------------------------------------------
def create_layout
@background = Plane.new
@background.bitmap = Cache.system("Save_Background")
@background.z = 0
@layout_01 = Sprite.new
@layout_01.bitmap = Cache.system("Save_Layout01")
@layout_01.z = 1
@layout_01.blend_type = 1
image = Cache.system("Save_Layout02")
@bitmap = Bitmap.new(image.width,image.height)
cw = image.width
ch = image.height / 2
if @saving
h = 0
else
h = ch
end
src_rect = Rect.new(0, h, cw, ch)
@bitmap.blt(0,0, image, src_rect)
@layout_02 = Sprite.new
@layout_02.bitmap = @bitmap
@layout_02.z = 3
@layout_02.y = 370
image.dispose
end
#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------
def execute_dispose
return if @background == nil
Graphics.freeze
@background.bitmap.dispose
@background.dispose
@background = nil
@layout_01.bitmap.dispose
@layout_01.dispose
@layout_02.bitmap.dispose
@layout_02.dispose
@bitmap.dispose
dispose_item_windows
end
#--------------------------------------------------------------------------
# ● Frame Update
#--------------------------------------------------------------------------
def update
update_savefile_windows
update_savefile_selection
check_start_index
end
#--------------------------------------------------------------------------
# ● check_start_index
#--------------------------------------------------------------------------
def check_start_index
return if @check_prev_index == false
@check_prev_index = false
check_active_window
end
#--------------------------------------------------------------------------
# ● check_active_window
#--------------------------------------------------------------------------
def check_active_window
@index = 0 if @index == nil
for i in 0...@file_max
@pw = @index - 1
@pw = 0 if @pw > @file_max - 1
@pw = @file_max- 1 if @pw < 0
@aw = @index
@nw = @index + 1
@nw = 0 if @nw > @file_max - 1
@nw = @file_max - 1 if @nw < 0
case @savefile_windows[i].file_index
when @pw,@nw
@savefile_windows[i].visible = true
@savefile_windows[i].contents_opacity = 80
when @aw
@savefile_windows[i].visible = true
@savefile_windows[i].contents_opacity = 255
else
@savefile_windows[i].visible = false
end
end
end
#--------------------------------------------------------------------------
# ● Create Save File Window
#--------------------------------------------------------------------------
def create_savefile_windows
@pw_pos = [-160,32]
@aw_pos = [-96,160]
@nw_pos = [-32,288]
@savefile_windows = []
for i in 0...@file_max
@savefile_windows[i] = Window_SaveFile_A.new(i, DataManager.make_filename(i))
@savefile_windows[i].z = 2
@savefile_windows[i].visible = false
@savefile_windows[i].x = 400
end
check_active_window
@item_max = @file_max
end
#--------------------------------------------------------------------------
# ● Dispose of Save File Window
#--------------------------------------------------------------------------
def dispose_item_windows
for window in @savefile_windows
window.dispose
end
end
#--------------------------------------------------------------------------
# ● Update Save File Window
#--------------------------------------------------------------------------
def update_savefile_windows
update_slide_window
for window in @savefile_windows
window.update
end
end
#--------------------------------------------------------------------------
# ● update_slide_window
#--------------------------------------------------------------------------
def update_slide_window
@background.ox += 1
slide_window_x(@pw,@pw_pos[0])
slide_window_x(@aw,@aw_pos[0])
slide_window_x(@nw,@nw_pos[0])
slide_window_y(@pw,@pw_pos[1])
slide_window_y(@aw,@aw_pos[1])
slide_window_y(@nw,@nw_pos[1])
end
#--------------------------------------------------------------------------
# ● slide_window_x
#--------------------------------------------------------------------------
def slide_window_x(i,x_pos)
if @savefile_windows[i].x < x_pos
@savefile_windows[i].x += 15
@savefile_windows[i].x = x_pos if @savefile_windows[i].x > x_pos
end
if @savefile_windows[i].x > x_pos
@savefile_windows[i].x -= 15
@savefile_windows[i].x = x_pos if @savefile_windows[i].x < x_pos
end
end
#--------------------------------------------------------------------------
# ● slide_window_y
#--------------------------------------------------------------------------
def slide_window_y(i,y_pos)
if @savefile_windows[i].y < y_pos
@savefile_windows[i].y += 15
@savefile_windows[i].y = y_pos if @savefile_windows[i].y > y_pos
end
if @savefile_windows[i].y > y_pos
@savefile_windows[i].y -= 15
@savefile_windows[i].y = y_pos if @savefile_windows[i].y < y_pos
end
end
#--------------------------------------------------------------------------
# ● reset_position
#--------------------------------------------------------------------------
def reset_position(diretion)
check_active_window
case diretion
when 0
@savefile_windows[@pw].y = -64
@savefile_windows[@pw].x = 0
when 1
@savefile_windows[@nw].y = 440
@savefile_windows[@nw].x = 0
end
end
#--------------------------------------------------------------------------
# ● Update Save File Selection
#--------------------------------------------------------------------------
def update_savefile_selection
if Input.trigger?(Input::C)
on_savefile_ok
elsif Input.trigger?(Input::B)
Sound.play_cancel
return_scene
else
last_index = @index
if Input.trigger?(Input::DOWN)
execute_index(1)
if @file_max > 2
reset_position(1)
else
reset_position(0)
end
end
if Input.trigger?(Input::UP)
execute_index(-1)
reset_position(0)
end
if @index != last_index
Sound.play_cursor
@savefile_windows[last_index].selected = false
@savefile_windows[@index].selected = true
end
end
end
#--------------------------------------------------------------------------
# ● Execute Index
#--------------------------------------------------------------------------
def execute_index(value)
@index += value
@index = @index >= @file_max ? 0 : @index < 0 ? (@file_max - 1) : @index
end
end
$mog_rgss3_scene_file = true
I will also include the necessary images for the script to work, obviously all credits still go to Moghunter (see the images at the bottom of the post).
Can we make it work in conjuction with the custom quick-save script that I have been using until now? It has mostly been made and edited my members on this forums per requests, so I doubt you will find it anywhere else on the net. I imagine it would be easier editing this script than it would be editing the above one:
Code:
=begin
====================================================================
GENERAL INFORMATION
--------------------------------------------------------------------
Title: Quick Save/Load System
Author: Adiktuzmiko
Version: 1.01 - Khas' Fix
Requirements: None
This script allows you to set a button in the game for quick save and load.
If you press the quicksave button, the game will automatically save
your progress in the designated slot without going thru the save screen.
The same goes for quickload.
====================================================================
====================================================================
FEATURES
--------------------------------------------------------------------
Quick Save/Load Anytime
- Save/Load your progress with the press of a button
Customizable
- Modify which file index is used as the quick slot
- Modify which buttons
- Determine if quick system is usable in battle and during show text
event commands
Works with Khas' Awesome Light Effects
====================================================================
====================================================================
INSTRUCTIONS
--------------------------------------------------------------------
After importing this script to your project, go to the config part
below (after TERMS AND CONDITIONS) and edit to suit your needs.
====================================================================
====================================================================
TERMS AND CONDITIONS
--------------------------------------------------------------------
View it here: http://lescripts.wordpress.com/terms-and-conditions/
====================================================================
=end
module ADIK
module QUICK
#Is the system enabled?
ENABLED = true
#Save file index to be used by Quick save/load
#Note that by default the first file is index 0
INDEX = 1
#SaveLoad Keybindings
#Default are L and R keys (Q/W at the keyboard by default)
SAVE_KEY = :L
LOAD_KEY = :L
#Set these if you want to use a button "combo" to activate the system
#Example if SAVE_KEY is set as :L and SAVE_KEY_2 is set as :A
#then you need to press both to activate the quick save
SAVE_KEY_2 = nil
LOAD_KEY_2 = :A
#Is the system allowed in battle scene?
#I suggest keeping this as false
ALLOW_AT_BATTLE = false
#Is the system allowed during the Show Text event command?
ALLOW_AT_TEXT = false
end
end
# DO NOT EDIT BELOW THIS LINE
if ADIK::QUICK::ENABLED
class Scene_Quick < Scene_File
attr_accessor :quick_save
attr_accessor :quick_load
def create_help_window
end
def help_window_text
end
def create_savefile_viewport
@savefile_viewport = Viewport.new
@savefile_viewport.rect.y = 0
@savefile_viewport.rect.height = 0
end
def create_savefile_windows
@savefile_windows = Array.new(item_max) do |i|
Window_SaveFile.new(savefile_height, i)
end
@savefile_windows.each {|window| window.viewport = @savefile_viewport; window.hide }
end
def init_selection
end
def update
if @quick_save
if DataManager.save_game(ADIK::QUICK::INDEX)
Sound.play_save
else
Sound.play_buzzer
end
@quick_save = false
SceneManager.return
end
if @quick_load
if DataManager.load_game(ADIK::QUICK::INDEX)
Sound.play_load
$game_system.on_after_load
@quick_load = false
SceneManager.goto(Scene_Map)
else
Sound.play_buzzer
@quick_load = false
SceneManager.return
end
end
end
def quicksave
@quick_save = true
end
def quickload
@quick_load = true
end
end
class Scene_Base
def quicksave
SceneManager.call(Scene_Quick)
SceneManager.scene.quicksave
end
def quickload
SceneManager.call(Scene_Quick)
SceneManager.scene.quickload
end
def is_quicksave
if ADIK::QUICK::SAVE_KEY_2 != nil
return (Input.trigger?(ADIK::QUICK::SAVE_KEY) and Input.press?(ADIK::QUICK::SAVE_KEY_2))
else
if ADIK::QUICK::LOAD_KEY_2 != nil
return false if Input.press?(ADIK::QUICK::LOAD_KEY_2)
end
return Input.trigger?(ADIK::QUICK::SAVE_KEY)
end
end
def is_quickload
if ADIK::QUICK::LOAD_KEY_2 != nil
return (Input.trigger?(ADIK::QUICK::LOAD_KEY) and Input.press?(ADIK::QUICK::LOAD_KEY_2))
else
if ADIK::QUICK::SAVE_KEY_2 != nil
return false if Input.press?(ADIK::QUICK::SAVE_KEY_2)
end
return Input.trigger?(ADIK::QUICK::LOAD_KEY)
end
end
def quicksystem
if is_quicksave and not SceneManager.scene_is?(Scene_Save)
if SceneManager.scene_is?(Scene_Battle) then
if ADIK::QUICK::ALLOW_AT_BATTLE
quicksave
end
else
quicksave
end
return
end
if is_quickload and not SceneManager.scene_is?(Scene_Load)
if SceneManager.scene_is?(Scene_Battle) then
if ADIK::QUICK::ALLOW_AT_BATTLE
quickload
end
else
quickload
end
return
end
end
alias update_quicksystem update
def update
update_quicksystem
quicksystem
end
end
class Game_Interpreter
def wait_for_message
while $game_message.busy?
SceneManager.scene.quicksystem
Fiber.yield
end
end
end
end
Trying to use the quick-save now (by the time I installed moghunter's script I mean), I get the following error:
Script 'Scene_File' line 89: NoMethodError occured.
undefined method `rect' for nil:NilClass
undefined method `rect' for nil:NilClass
The referred line is the following:
Code:
def savefile_height
@savefile_viewport.rect.height / visible_max
end
Thanks for your time! If you have any questions, feel free to ask. The script will be used for my free-to-play Broken Reality, and credits will be given properly.
Attachments
-
5.2 KB Views: 2
-
8.2 KB Views: 2
-
4.4 KB Views: 3
-
17.9 KB Views: 2
-
15.5 KB Views: 2
-
11.3 KB Views: 2
-
8.9 KB Views: 2
-
10.1 KB Views: 2
Last edited:

