Sostituisce la schermata di default per salvare la partita o caricarla, mettendo lo sviluppatore in condizione di personalizzarla ampiamente tramite immagini. Come originariamente progettato, ideale per integrare il look-n-feel di questo sistema con Title e Menù creati su mappa tramite comandi evento e pictures. E' stato creato e usato, in variante molto ridotta e su misura in versione 1.0, nel gioco "Restricted: Project 15" di kekkorider.
SCREENSHOTS
Spoiler
TUTTI RELATIVI ALLA CONFIGURAZIONE D'ESEMPIO (DEFAULT)
Schermata Salvataggio Slot 1 (già usato)
Schermata Caricamento Slot 2 (già usato)
Schermata Salvataggio Slot 3 (già usato)
Schermata Caricamento Slot 4 (inutilizzato)
Autore
giver, di RPG2S. Vedere la sezione Altri Dettagli per il CHANGELOG.
Allegati
Essendo uno script particolarmente esoso in termini di risorse personalizzate, è stato realizzato un pacchetto con tutte le risorse necessarie a vederlo in azione, con la configurazione di default, e comprendere meglio la relazione tra le risorse e quanto scritto nelle impostazioni (soprattutto per quel concerne l'immagine con i SIMBOLI per disegnare il tempo di gioco). http://afantasymachi...llaGraphics.zip
Inoltre, i due background sono riproposti qui sotto senza le scritte nell'intestazione. Per poterle usare dopo la modifica bisogna rinominarle eliminando "_noLabels" dai loro nomi e metterle nella cartella Titles.
Spoiler
Istruzioni per l'uso
Lo script si compone di due parti, ed è meglio inserire ciascuna in uno spazio differente dello script editor, per evitare confusione: la sezione di configurazione, che va messa sopra l'altra, e l'engine che è lo script vero e proprio. Come sempre, vanno inserite al di sotto di Scene_Debug ed al di sopra di altri script personalizzati che potrebbero appoggiarsi alle scene Load e Save.
Cosa si può personalizzare senza mettere le mani nel codice dello script principale:
Spoiler
module TCSS_CFG è la sezione di configurazione. SLOT_W è la larghezza di ciascuna immagine associata agli slot di salvataggio. SLOT_H è l'altezza di ciascuna immagine associata agli slot di salvataggio. SLOTS_XY_LIST è un array di arrays con le coordinate dell'angolo superiore sinistro delle immagini associate a ciascuno slot. Es. [[8, 256], [96, 64], [192, 96], [224, 256], [320, 192], [416, 176], [600, 152]] dispone SETTE slots ad imitare vagamente l'Orsa Maggiore . . . SLOT_BASE_NAME è il nome base delle immagini rappresentanti gli slot vuoti. Se si decide di non usare immagini identiche per tutti gli slots, vedere più sotto, il nome completo di tali immagini avrà l'indice dello slot in coda al nome base, partendo da 1, senza zeri davanti. Es. Con nome base "slot", il primo slot, se vuoto mostrerà l'immagine slot1.png, il secondo slot mostrerà, se vuoto, l'immagine slot2.png, ecc. SLOT_FULL_SUFFIX è il suffisso che viene applicato ai nomi delle immagini che rappresentano slot pieni. Es. impostandolo a "_pieno", con nome base "slot", le immagini per gli slot pieni dovranno chiamarsi slotN_pieno.png, oppure slot_pieno, se si imposta a true la costante appena più sotto. USE_SAME_GRAPHIC_FOR_ALL_SLOTS serve ad indicare se si vuole usare solo una coppia di immagini per tutti gli slot (slot vuoto e slot pieno), impostandolo a true, invece che usare due immagini per ogni slot di salvataggio nella schermata (8 immagini per 4 slots). SLOTS_IN_ASCENDING_Z serve ad indicare se si vuole che lo slot successivo possa coprire in parte quello precedente, impostandolo a true. CHAPTERS_SCREEN_LIST è un array con l'elenco dei nomi, ciascuno tra virgolette, delle immagini associate ai vari capitoli previsti nel gioco. Es. ["capitolo01", "capitolo02", "capitolo03", "capitolo04", "capitolo05", "capitolo06", "capitolo07", "capitolo08", "capitolo09", "capitolo10", "capitolo11"] è una lista di immagini associate ad 11 capitoli. Ovviamente si possono scegliere nomi più intuitivi per tali immagini . . . SCREEN_W è la larghezza delle immagini legate ai capitoli. SCREEN_H è l'altezza delle immagini legate ai capitoli. SCREEN_XY è un array con le coordinate dell'angolo superiore sinistro dell'immagine rappresentativa del capitolo, memorizzato nella variabile evento apposita, vedere sotto, al momento del salvataggio. NO_SCREEN_NAME è l'immagine che viene mostrata quando un capitolo non ha un'immagine associata, come quello 0 [o 12+, nel caso dell'esempio fatto sopra]. FACE_W è la larghezza delle immagini usate come "faces". FACE_H è l'altezza delle immagini usate come "faces". FACES_XY_LIST è un array di arrays, ciascuno contenente le coordinate dell'angolo superiore sinistro di ogni face di membro del party che si vuole visualizzare. Es. [[192, 68], [192, 168]] mostrerà i faces dei primi due membri del party, il primo alle coordinate x=192 e y=68, ed il secondo alle coordinate x=192 ed y=168 ("incolonnati"). FACE_NAME_SUFFIX è il suffisso aggiunto al nome dell'immagine del character dei personaggi per sapere qual è l'immagine da usare come suo face. FACE_EMPTYSLOT_SAVE è il nome base, a cui viene aggiunto il suffisso impostato, dell'immagine da usare per riempire i faces vuoti nella schermata di salvataggio. FACE_EMPTYSLOT_LOAD è il nome base, a cui viene aggiunto il suffisso impostato, dell'immagine da usare per riempire i faces vuoti nella schermata di caricamento. FACES_IN_DESCENDING_Z serve ad indicare se si vuole che, in caso di sovrapposizioni tra faces, quello successivo venga coperto da quello precedente, impostando a true. DISABLE_TIME serve ad indicare se non si vuole mostrare il Tempo di Gioco nelle schermate di salvataggio e caricamento, impostandolo a true. DIGITS_STRIP_NAME è il nome dell'immagine contenente le cifre ed i separatori usati per scrivere il Tempo di Gioco. Deve essere composta da una serie di 12 riquadri consecutivi della stessa dimensione, ognuno dei quali deve contenere una cifra o simbolo da utilizzare, obbligatoriamente in sequenza0123456789-:. TIME_W è la larghezza della sezione dedicata ad indicare il Tempo di Gioco. TIME_H è l'altezza della sezione dedicata ad indicare il Tempo di Gioco. Tenere conto che le cifre ed i separatori vengono disegnati con la base attaccata al lato inferiore di questa area. TIME_XY sono le coordinate dell'angolo superiore sinistro della sezione dedicata al Tempo di Gioco. TIME_BG_NAME è il nome dell'etichetta e fondale della sezione relativa al tempo di Gioco. TIME_DIGITS_OFFX è la distanza in pixel dal lato sinistro del contenuto relativo al Tempo di Gioco a cui cominciare a disegnare ore, minuti e secondi. DISABLE_MAP_NAME serve ad indicare se non si vuole mostrare il nome delle mappe nelle schermate di salvataggio e caricamento, impostandolo a true. MAP_NAME_W è la larghezza delle immagini con il nome delle mappe da mostrare. MAP_NAME_H è l'altezza delle immagini con il nome delle mappe da mostrare. MAP_NAME_XY è l'array dove sono indicate le coordinate dell'angolo superiore sinistro delle immagini con il nome della mappa da indicare. UNKNOWN_NAME è il nome dell'immagine da mostrare quando non è disponibile il nome di quella da mostrare, nella schermata di caricamento. SAVE_BG_NAME è il nome del Title usato come background nella schermata di salvataggio. LOAD_BG_NAME è il nome del Title usato come background nella schermata di caricamento. CURSOR_NAME è il nome dell'immagine da usare come cursore. CURSOR_OFFXY è l'indicazione della posizione relativa dell'angolo superiore sinistro del cursore rispetto a quello della finestra dello slot. Se lasciato come impostato di default, tale angolo corrisponderà a quello della grafica dello slot. CURSOR_BLINK è l'opzione per indicare se si vuole che il cursore lampeggi o resti fisso. UPDOWN_STEP è la quantità di slots di spostamento del cursore se si preme FRECCIA SU o GIù. Questa opzione serve per gestire meglio un layout con più righe formate da più slots di salvataggio. CHAPTER_GVAR_ID è l'id della variabile in cui lo sviluppatore indica qual è il capitolo corrente, ricordandosi che il numero identificativo dei capitoli parte comunque dal valore 1.
Script
CONFIGURAZIONE (prima parte del sistema)
Spoiler
#******************************************************************************
# TALE CHAPTERS SAVE SYSTEM v 2.0 by giver (RPG2S) - PART 1: CONFIGURATION
#******************************************************************************
#
# CONFIGURATION START ===============================================
#
#******************************************************************************
#
# NOTES: ALL images go in the Pictures folder, with the exception of the Load
# and Save scene BackGrounds, that go in the Titles folder
# As noted in the Changelog section, ALL windows show only their
# contents, thus the coordinates to be set in the configuration
# are those of the top left corner of the graphics used in them.
# The script will automatically adjust the windows position correctly
#------------------------------------------------------------------------------
module TCSS_CFG
# Settings for the SLOT windows CONTENTS
SLOT_W = 96
SLOT_H = 96
# List of SLOTS coordinates, to be written as [coord_x, coord_y]
# followed by a comma if not related to the LAST slot
SLOTS_XY_LIST = [
[4, 68],
[4, 172],
[4, 276],
[4, 380]
]
# SLOT IMAGE names PARTS (name+index+suffix) [1st INDEX is 1, not 0]
SLOT_BASE_NAME = "slot"
SLOT_FULL_SUFFIX = "_full"
# 3rd Slot complete images name are slot3.png and slot3_full.png
# OR, to spare on graphics needed for the Slots, set this to true
# the slots images name become slot.png and slot_full.png
USE_SAME_GRAPHIC_FOR_ALL_SLOTS = false
# Overlaying of SLOTS. Default (true) means slot_2 would overlaps slot_1
SLOTS_IN_ASCENDING_Z = true
#
# List of images related to each CHAPTER
CHAPTERS_SCREEN_LIST = [
"ch01",
"ch02",
"ch03",
"ch04",
"ch05",
"ch06",
"ch07",
"ch08",
"ch09",
"ch10",
"ch11",
"ch12"
]
# Settings for the CHAPTER SCREEN window CONTENTS
SCREEN_W = 320
SCREEN_H = 180
# Image top left corner COORDINATES
SCREEN_XY = [120, 132]
# Image name if there is no SCREEN for the current CHAPTER ID (minus 1)
NO_SCREEN_NAME = "gamelife"
#
# Settings for the actors "FACES" windows CONTENTS
FACE_W = 96
FACE_H = 144
# List of "FACES" coordinates, to be written as [coord_x, coord_y]
# followed by a comma if not related to the LAST "face"
FACES_XY_LIST = [
[144, 328],
[264, 328],
[384, 328],
[504, 328]
]
# The "face" image should have a name made by its Character graphics name
# plus the suffix set below. E.G. An actor with a Character image name
# of 001-Fighter01 must have a face image named 001-Fighter01_saveface
FACE_NAME_SUFFIX = "_saveface"
# The image base name if the FACE window has no actor assigned to it
# The image file should include the SUFFIX indicated above
FACE_EMPTYSLOT_SAVE = "shadow" # shadow_saveface.png
FACE_EMPTYSLOT_LOAD = "nobody" # nobody_saveface.png
# Overlayering of FACES. Default (true) means the 1st Face would overlap,
# cover, the 2nd Face
FACES_IN_DESCENDING_Z = true
#
# Settings for the GAMETIME window CONTENTS
# To not show the GAMETIME in the Load and Save scenes, set it to true
DISABLE_TIME = false
# A 12 MONOSPACED characters line-up IMAGE "0123456789-:"
DIGITS_STRIP_NAME = "savedigits"
TIME_W = 128
TIME_H = 96
# Coordinates of the top left corner of the GAMETIME contents
TIME_XY = [472, 160]
# (BG with the) LABEL for the GAMETIME section of the scene screen
TIME_BG_NAME = "savetimeBG"
# Distance of the first GAMETIME digit from the left side of the contents
TIME_DIGITS_OFFX = 8
#
# Settings for the MAP NAME window CONTENTS
# To not show the MAP NAME in the Load and Save scenes, set it to true
DISABLE_MAP_NAME = false
MAP_NAME_W = 512
MAP_NAME_H = 40
# Coordinates of the top left corner of the MAP NAME contents
MAP_NAME_XY = [116, 76]
# Map Name IMAGE NAME for Empty SLOTS in the LOAD scene. Otherwise
# (usually) the Map Name in the MAP EDITOR is used as name for the
# IMAGE FILE with the Map Name to SHOW
UNKNOWN_NAME = "unknown"
#
# Settings for the Scene Load/Save BackGrounds
SAVE_BG_NAME = "SaveBG"
LOAD_BG_NAME = "LoadBG"
#
# Settings for the sprite used as SLOTS cursor in the scenes
# The image, if the offsets aren't changed, should have the SAME
# size as the SLOTS CONTENTS set above, and OVERLAPS them
CURSOR_NAME = "saveslots_cursor"
# CURSOR top Left corner offsets from SLOT WINDOWS top left corner
CURSOR_OFFXY = [16, 16]
# To enable cursor blinking, set it to true
CURSOR_BLINK = true
# The quantity of SLOTS of cursor movement when pressing UP or DOWN
# LEFT and RIGHT always have a STEP of 1
UPDOWN_STEP = 1
# ID of the game variable where the current chapter number is stored
# 1st CHAPTER has value 1, 2nd CHAPTER has value 2, and so on
CHAPTER_GVAR_ID = 100
#
end
#******************************************************************************
#
# CONFIGURATION END =================================================
#
#******************************************************************************
ENGINE (seconda parte del sistema)
Spoiler
#==============================================================================
# TALE CHAPTERS SAVE SYSTEM v 2.0 by giver (RPG2S) - PART 2: ENGINE
#==============================================================================
#
# ReRevised Scene Save"N"Load by giver [Tale Chapters Save System]
# CHANGELOG
#
# v. 2.0 Flexi MED (Customizable Layout) datecode 20180329-20180406
# * Configuration moved in module TCSS_CFG
# Restored some options not needed by Kekkorider
# * All TEXT elements use IMAGES, including TIME and MAP NAMES if enabled
# [i.e. Originally developed to merge in a project that has both
# Title and Menu created using maps, with Pictures and Characters]
# * TAG images used in the save slots are defined by Chapter ID instead
# of current MAP (no more Save Points), indicated in a Game Variable
# * Save slots quantity can be different from the default 4, but all of
# them must be visible in the 640x480 screen area
# * Any desired frame must be drawn in the Graphics used for the
# system, because its windows have opacity 0, hiding both their
# frame and their background completely
#
# v. 1.01 (Basic Old Way) UltraLITE Redux it2/9/2009
# * Developed as requested by Kekkorider for his game Restricted - Project 15
#
#==============================================================================
# EDITING THE CODE BELOW THIS LINE IS AT YOUR OWN RISK
#------------------------------------------------------------------------------
class Scene_Title
map_infos = load_data("Data/MapInfos.rxdata")
$map_names = []
for key in map_infos.keys
$map_names[key] = map_infos[key].name
end
#
unless $@
alias giver_talesave_scetitle_updt update
end
def update
unless @rechecked_continue
for i in 0...TCSS_CFG::SLOTS_XY_LIST.size
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @command_window != nil
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
end
@rechecked_continue = true
end
giver_talesave_scetitle_updt
end
end
class Game_Map
def map_name(map_id = @map_id)
return $map_names[map_id]
end
end
class Game_Party
def refresh(actors_db = $game_actors)
new_actors = []
for i in [email protected]
if $data_actors[@actors[i].id] != nil
new_actors.push(actors_db[@actors[i].id])
end
end
@actors = new_actors
end
end
class Window_SaveFile < Window_Base
#
def initialize(file_index)
super(0, 0, TCSS_CFG::SLOT_W + 32, TCSS_CFG::SLOT_H + 32)
self.contents = Bitmap.new(width - 32, height - 32)
zorder = (TCSS_CFG::SLOTS_IN_ASCENDING_Z == true) ? file_index :
-file_index
self.z += (100 + zorder)
self.opacity = 0
@file_index = file_index
@file_name = $scene.make_filename(@file_index)
@file_exist = FileTest.exist?(@file_name)
refresh
end
#
def refresh
slot_pic_name = TCSS_CFG::SLOT_BASE_NAME
unless TCSS_CFG::USE_SAME_GRAPHIC_FOR_ALL_SLOTS
slot_pic_name += (@file_index+1).to_s
end
unless @file_exist
self.contents = RPG::Cache.picture(slot_pic_name)
else
self.contents = RPG::Cache.picture(slot_pic_name + TCSS_CFG::SLOT_FULL_SUFFIX)
end
end
#
end
class Window_SaveScreen < Window_Base
#
def initialize
super(TCSS_CFG::SCREEN_XY[0] - 16, TCSS_CFG::SCREEN_XY[1] - 16, TCSS_CFG::SCREEN_W +
32, TCSS_CFG::SCREEN_H + 32)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
end
#
def set_data(chapter_index)
unless chapter_index.nil? or chapter_index == -1 or TCSS_CFG::CHAPTERS_SCREEN_LIST[chapter_index].nil?
chapter_name = TCSS_CFG::CHAPTERS_SCREEN_LIST[chapter_index]
else
chapter_name = TCSS_CFG::NO_SCREEN_NAME
end
self.contents = RPG::Cache.picture(chapter_name)
end
#
end
class Window_SaveFace < Window_Base
#
def initialize(actor_index)
super(0, 0, TCSS_CFG::FACE_W + 32, TCSS_CFG::FACE_H + 32)
@actor_index = actor_index
self.contents = Bitmap.new(width - 32, height - 32)
zorder = (TCSS_CFG::FACES_IN_DESCENDING_Z == true) ? -@actor_index :
@actor_index
self.z += (100 + zorder)
self.opacity = 0
end
#
def set_data(save_party)
if save_party != nil and save_party[@actor_index] != nil
facename = save_party[@actor_index].character_name
else
if $scene.is_a?(Scene_Save)
facename = TCSS_CFG::FACE_EMPTYSLOT_SAVE
else
facename = TCSS_CFG::FACE_EMPTYSLOT_LOAD
end
end
self.contents = RPG::Cache.picture(facename + TCSS_CFG::FACE_NAME_SUFFIX)
end
#
end
class Window_SaveTime < Window_Base
#
def initialize
super(TCSS_CFG::TIME_XY[0] - 16, TCSS_CFG::TIME_XY[1] - 16, TCSS_CFG::TIME_W + 32,
TCSS_CFG::TIME_H + 32)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
end
#
def set_data(saveplaytime)
self.contents.clear
unless TCSS_CFG::DISABLE_TIME
label = RPG::Cache.picture(TCSS_CFG::TIME_BG_NAME)
self.contents.blt(0, 0, label, label.rect)
label.dispose
if saveplaytime != nil
total_secs = saveplaytime / Graphics.frame_rate
hours = total_secs / 60 / 60
hr_1s = hours % 10
hr_10s = hours / 10
mins = total_secs / 60 % 60
m_1s = mins % 10
m_10s = mins / 10
secs = total_secs % 60
s_1s = secs % 10
s_10s = secs / 10
time = [hr_10s, hr_1s, 11, m_10s, m_1s, 11, s_10s, s_1s]
else
time = [10, 10, 11, 10, 10, 11, 10, 10]
end
draw_time(time)
end
end
#
def draw_time(digits_list)
digits = RPG::Cache.picture(TCSS_CFG::DIGITS_STRIP_NAME)
for i in 0...8
src_rect = Rect.new(digits_list[i] * (digits.width / 12), 0,
digits.width / 12, digits.height)
self.contents.blt((digits.width / 12) * i + TCSS_CFG::TIME_DIGITS_OFFX,
self.contents.height - digits.height, digits, src_rect)
end
digits.dispose
end
#
end
class Window_SaveMapName < Window_Base
#
def initialize
super(TCSS_CFG::MAP_NAME_XY[0] - 16, TCSS_CFG::MAP_NAME_XY[1] - 16, TCSS_CFG::MAP_NAME_W +
32, TCSS_CFG::MAP_NAME_H + 32)
self.opacity = 0
end
#
def set_data(mapid)
unless TCSS_CFG::DISABLE_MAP_NAME
if mapid.to_i > 0
mapname = $game_map.map_name(mapid)
else
mapname = TCSS_CFG::UNKNOWN_NAME
end
self.contents = RPG::Cache.picture(mapname)
end
end
#
end
class Scene_Save < Scene_File
#
def get_scene_bg
return TCSS_CFG::SAVE_BG_NAME
end
#
end
class Scene_Load < Scene_File
#
def get_scene_bg
return TCSS_CFG::LOAD_BG_NAME
end
#
unless $@
alias giver_talesave_sceload_init initialize
end
def initialize
giver_talesave_sceload_init
latest_time = Time.at(0)
for i in 0...TCSS_CFG::SLOTS_XY_LIST.size
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
end
#
end
class Scene_File
#
def initialize(help_text)
end
#
def main
@scene_bg = Sprite.new
bg_label = RPG::Cache.title( (get_scene_bg.to_s) )
@scene_bg.bitmap = bg_label
@savefile_windows = []
@savedata = []
for i in 0...TCSS_CFG::SLOTS_XY_LIST.size
name = make_filename(i)
@savefile_windows.push( Window_SaveFile.new(i) )
@savefile_windows[i].x = TCSS_CFG::SLOTS_XY_LIST[i][0] - 16
@savefile_windows[i].y = TCSS_CFG::SLOTS_XY_LIST[i][1] - 16
@savedata[i] = make_slot_data(name)
end
@cursor = RPG::Sprite.new
@cursor.bitmap = RPG::Cache.picture(TCSS_CFG::CURSOR_NAME)
@cursor.blink_on if TCSS_CFG::CURSOR_BLINK
@cursor.blend_type = 1
@time_window = Window_SaveTime.new
@mapname_window = Window_SaveMapName.new
@screen_window = Window_SaveScreen.new
@face_windows = []
for i in 0...TCSS_CFG::FACES_XY_LIST.size
face_window = Window_SaveFace.new(i)
face_window.x = TCSS_CFG::FACES_XY_LIST[i][0] - 16
face_window.y = TCSS_CFG::FACES_XY_LIST[i][1] - 16
@face_windows.push(face_window)
end
@file_index = $game_temp.last_file_index
update_cursor
update_slot_data
Graphics.transition(20)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@time_window.dispose
@mapname_window.dispose
@screen_window.dispose
for i in @face_windows
i.dispose
end
@face_windows.clear
@face_windows = nil
@savedata.clear
@savedata = nil
@cursor.bitmap.dispose
@cursor.dispose
for i in @savefile_windows
i.dispose
end
@savefile_windows.clear
@savefile_windows = nil
@scene_bg.bitmap.dispose
@scene_bg.dispose
end
#
def update
@time_window.update
@mapname_window.update
@screen_window.update
for f in @face_windows
f.update
end
for s in @savefile_windows
s.update
end
@cursor.update
if Input.trigger?(Input::C)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
elsif Input.trigger?(Input::B)
on_cancel
return
end
if Input.repeat?(Input::DOWN)
if Input.trigger?(Input::DOWN) or
@file_index < (TCSS_CFG::SLOTS_XY_LIST.size - TCSS_CFG::UPDOWN_STEP)
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + TCSS_CFG::UPDOWN_STEP) % TCSS_CFG::SLOTS_XY_LIST.size
update_cursor
update_slot_data
return
end
elsif Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @file_index > (TCSS_CFG::UPDOWN_STEP - 1)
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + TCSS_CFG::SLOTS_XY_LIST.size -
TCSS_CFG::UPDOWN_STEP) % TCSS_CFG::SLOTS_XY_LIST.size
update_cursor
update_slot_data
return
end
end
if Input.repeat?(Input::RIGHT)
if Input.trigger?(Input::RIGHT) or
@file_index < (TCSS_CFG::SLOTS_XY_LIST.size - 1)
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + 1) % TCSS_CFG::SLOTS_XY_LIST.size
update_cursor
update_slot_data
return
end
elsif Input.repeat?(Input::LEFT)
if Input.trigger?(Input::LEFT) or @file_index > 0
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + TCSS_CFG::SLOTS_XY_LIST.size - 1) %
TCSS_CFG::SLOTS_XY_LIST.size
update_cursor
update_slot_data
return
end
end
end
#
def make_filename(file_index)
return "Save#{file_index + 1}.rxdata"
end
#
def make_slot_data(filename)
save_info = []
if FileTest.exist?(filename)
file = File.open(filename, "r")
Marshal.load(file)
frame_count = Marshal.load(file)
Marshal.load(file) # game_system = Marshal.load(file)
Marshal.load(file)
game_variables = Marshal.load(file)
Marshal.load(file)
Marshal.load(file)
game_actors = Marshal.load(file)
game_party = Marshal.load(file)
Marshal.load(file)
game_map = Marshal.load(file)
file.close
game_party.refresh(game_actors)
save_info[0] = frame_count
save_info[1] = game_party.actors
save_info[2] = game_variables[TCSS_CFG::CHAPTER_GVAR_ID] - 1
save_info[3] = game_map.map_id
end
return save_info
end
#
def update_cursor
@cursor.z = @savefile_windows[@file_index].z + 3
@cursor.x = @savefile_windows[@file_index].x + TCSS_CFG::CURSOR_OFFXY[0]
@cursor.y = @savefile_windows[@file_index].y + TCSS_CFG::CURSOR_OFFXY[1]
end
#
def update_slot_data
save_info = @savedata[@file_index]
@mapname_window.set_data(save_info[3])
@screen_window.set_data(save_info[2])
@time_window.set_data(save_info[0])
for f in @face_windows
f.set_data(save_info[1])
end
end
#
end
Essendo un sistema a sè stante, non dovrebbero esserci conflitti particolari, a meno di avere script che NON inseriscono e caricano nuovi dati dopo quelli di default, in quanto, per disegnare il contenuto dello slot che ha il cursore sopra, deve leggere le informazioni presenti nei salvataggi.
Vedere anche Una Scelta Discutibile, più sotto, nella sezione Altri Dettagli.
Altri dettagli
Come evidenziato nelle sezioni precedenti, il sistema è stato pensato per chi vorrebbe creare un save system con comandi evento ma ha notato quanto sia complicato emulare quelle funzioni su mappa, perciò lo script NON scrive assolutamente niente, ed ogni scritta va inserita come immagine o parte di un'immagine.
CONFIGURAZIONE (ESEMPIO 2, senza risorse allegate. Potete provare a crearle Voi per vedere se avete capito come funzionano le impostazioni dello script). Appartiene a quella che doveva essere una demo sotto forma di breve gioco incentrato su "salvataggi", ma purtroppo Vincent ci sta mettendo troppo per completarla, da cui desumo che non sia poi così breve come desideravo. La schermata è stata congeniata per avere l'intestazione, una finestra di file manager/explorer con 16 slots sulla metà sinistra, e "l'Anteprima del File" sulla metà destra . . . TCSS2 - Configurazione de "Il Viaggino dell'Eroe (Una Storia di Salvataggi)"
Spoiler
#******************************************************************************
# TALE CHAPTERS SAVE SYSTEM v 2.0 by giver (RPG2S) - PART 1: CONFIGURATION
#******************************************************************************
#
# CONFIGURATION START ===============================================
#
#******************************************************************************
#
# NOTES: ALL images go in the Pictures folder, with the exception of the Load
# and Save scene BackGrounds, that go in the Titles folder
# As noted in the Changelog section, ALL windows show only their
# contents, thus the coordinates to be set in the configuration
# are those of the top left corner of the graphics used in them.
# The script will automatically adjust the windows position correctly
#------------------------------------------------------------------------------
module TCSS_CFG
# Settings for the SLOT windows CONTENTS
SLOT_W = 64
SLOT_H = 84
# List of SLOTS coordinates, to be written as [coord_x, coord_y]
# followed by a comma if not related to the LAST slot
SLOTS_XY_LIST = [
[12, 80],
[84, 80],
[156, 80],
[228, 80],
[12, 176],
[84, 176],
[156, 176],
[228, 176],
[12, 272],
[84, 272],
[156, 272],
[228, 272],
[12, 368],
[84, 368],
[156, 368],
[228, 368]
]
# SLOT IMAGE names PARTS (name+index+suffix) [1st INDEX is 1, not 0]
SLOT_BASE_NAME = "save"
SLOT_FULL_SUFFIX = "_full"
# 3rd Slot complete images name are file3.png and file3_full.png
# OR, to spare on graphics needed for the Slots, set this to true
# the slots images name become file.png and file_full.png
USE_SAME_GRAPHIC_FOR_ALL_SLOTS = false
# Overlaying of SLOTS. Default (true) means slot_2 would overlaps slot_1
SLOTS_IN_ASCENDING_Z = true
#
# List of images related to each CHAPTER
CHAPTERS_SCREEN_LIST = [
"1st",
"2nd",
"3rd",
"4th",
"5th",
"6th",
"7th"
]
# Settings for the CHAPTER SCREEN window CONTENTS
SCREEN_W = 256
SCREEN_H = 192
# Image top left corner COORDINATES
SCREEN_XY = [344, 58]
# Image name if there is no SCREEN for the current CHAPTER ID (minus 1)
NO_SCREEN_NAME = "everyday"
#
# Settings for the actors "FACES" windows CONTENTS
FACE_W = 256
FACE_H = 96
# List of "FACES" coordinates, to be written as [coord_x, coord_y]
# followed by a comma if not related to the LAST "face"
FACES_XY_LIST = [
[344, 258]
]
# The "face" image should have a name made by its Character graphics name
# plus the suffix set below. E.G. An actor with a Character image name
# of 001-Fighter01 must have a face image named 001-Fighter01_saveface
FACE_NAME_SUFFIX = "_saveface"
# The image base name if the FACE window has no actor assigned to it
# The image file should include the SUFFIX indicated above
FACE_EMPTYSLOT_SAVE = "shadow" # shadow_saveface.png
FACE_EMPTYSLOT_LOAD = "shadow" # nobody_saveface.png
# Overlayering of FACES. Default (true) means the 1st Face would overlap,
# cover, the 2nd Face
FACES_IN_DESCENDING_Z = true
#
# Settings for the GAMETIME window CONTENTS
# To not show the GAMETIME in the Load and Save scenes, set it to true
DISABLE_TIME = false
# A 12 MONOSPACED characters line-up IMAGE "0123456789-:"
DIGITS_STRIP_NAME = "savesdigits"
TIME_W = 256
TIME_H = 48
# Coordinates of the top left corner of the GAMETIME contents
TIME_XY = [344, 362]
# (BG with the) LABEL for the GAMETIME section of the scene screen
TIME_BG_NAME = "savetimesBG"
# Distance of the first GAMETIME digit from the left side of the contents
TIME_DIGITS_OFFX = 140
#
# Settings for the MAP NAME window CONTENTS
# To not show the MAP NAME in the Load and Save scenes, set it to true
DISABLE_MAP_NAME = false
MAP_NAME_W = 256
MAP_NAME_H = 48
# Coordinates of the top left corner of the MAP NAME contents
MAP_NAME_XY = [344, 418]
# Map Name IMAGE NAME for Empty SLOTS in the LOAD scene. Otherwise
# (usually) the Map Name in the MAP EDITOR is used as name for the
# IMAGE FILE with the Map Name to SHOW
UNKNOWN_NAME = "nights"
#
# Settings for the Scene Load/Save BackGrounds
SAVE_BG_NAME = "saveBG"
LOAD_BG_NAME = "loadBG"
#
# Settings for the sprite used as SLOTS cursor in the scenes
# The image, if the offsets aren't changed, should have the SAME
# size as the SLOTS CONTENTS set above, and OVERLAPS them
CURSOR_NAME = "saves_cursor"
# CURSOR top Left corner offsets from SLOT WINDOWS top left corner
CURSOR_OFFXY = [16, 16]
# To enable cursor blinking, set it to true
CURSOR_BLINK = false
# The quantity of SLOTS of cursor movement when pressing UP or DOWN
# LEFT and RIGHT always have a STEP of 1
UPDOWN_STEP = 4
# ID of the game variable where the current chapter number is stored
# 1st CHAPTER has value 1, 2nd CHAPTER has value 2, and so on
CHAPTER_GVAR_ID = 100
#
end
#******************************************************************************
#
# CONFIGURATION END =================================================
#
#******************************************************************************
CHANGELOG della versione 2.0 (Flexi MED), con datecode jp20180404
Configurazione spostata in module TCSS_CFG.
Ripristinato opzioni che non servivano a Kekkorider.
TUTTI gli elementi di TESTO sono da inserire come IMMAGINI, incluso il Tempo di Gioco e i Nomi delle Mappe, se abilitati.
TUTTE le immagini rappresentative sono determinate dal valore di ID Capitolo, da indicare in una variabile evento, invece che dalla mappa in cui si effettua il salvataggio.
La quantità di slots per salvare può essere diversa da 4, ma TUTTI gli slots devono essere inclusi nella schermata di 640x480. Ovviamente non è previsto l'AutoSave, in quanto contrario al creare un'interfaccia ad alto impatto grafico.
TUTTE le finestre nascondono la propria cornice ed il proprio fondale, perciò qualunque cornice deve essere inclusa nelle immagini in cui li si desidera.
Una Scelta Discutibile: Ho fatto in modo che il controllo di presenza di salvataggi da eventualmente caricare sia effettuato nell'update di Scene_Title invece che nel suo metodo main. La ragione è relativamente stupida, e ne avevo già accennato quando ho postato la mia riscrittura del Constance CMS, solo che questa volta non ho voluto obbligare gli utilizzatori dello script a mettere le mani nel codice Ruby associato a questa verifica. Dove sta il problema, allora? Che il tipo di Title che ben si sposa con questo save system ha sicuramente il metodo main, ma non è garantito che abbia anche il metodo update . . . Cosa può comportare? Tanto per cominciare, se non è presente il metodo update e non è stato mantenuto lo Scene_Title di default, questo script dovrebbe dare un errore di No Method quando cerca di fare l'alias per estendere il metodo update. Ma se anche fosse stato mantenuto lo Scene_Title di default in assenza di metodo update nel Title "personalizzato", ovviamente il metodo non verrebbe chiamato da quest'ultimo e risulterebbe sempre che non ci sono salvataggi presenti . . .
Non era meglio appoggiarsi al metodo main, allora? Come ho detto prima la ragione per cui non l'ho fatto è abbastanza "stupida": Se il Title personalizzato si appoggia a quello di default, la "flag" (una specie di switch) che segnala la presenza dei salvataggi viene messa su false (OFF), all'interno del metodo main, proprio prima di fare tale controllo per i primi 4 slots, quindi la verifica potrebbe dare esito negativo qualora siano presenti più di quattro slots ed il primo save presente sia il QUINTO o superiore . . . Stupido, sì, vista la scarsa probabilità che ciò avvenga, ma a me dà comunque fastidio . . .