Salve a tutti, stavo lavorando su un progettino -sono ancora all'intro- e ho tra gli script quelli della visualizzazione degli oggetti trovato qui e uno dell'autosave di BulleXt.
Il problema sta che pare siano impatibili, in quanto se provo ad aprire l'autosalvataggio mi da un errore di "IO needed" nello script per gli oggetti. Volevo sapere se qualcuno magari riusciva a capire come mai o se poteva renderli compatibili ^^"
Io posto quello dell'autosave, così per ogni evenienza.
Avviso che non vi erano salvataggi antecedenti all'inserimento di entrambi gli script
=begin
AutoSave VX
Author: BulleXt(bulletxt@gmail.com)
Version: 0.1
Date: 06/07/2009
Description:
This script by default will automatically save when you do a map transfer,
after winning a battle and after exiting menu.
You can also manually call an autosave inside an event by simply doing a
call script like this:
Auto_Save.new
The script doesn't disable normal saving system so player can still save on his
slots, he will not be able to overwrite the autosave slot.
The script also lets you set how many saving slots you want.
=end
#This is the autosave slot number
SAVE_NUMBER = 1
#this is the number of how many saving slots you want
NUMBER_OF_SAVE_SLOTS = 10
#This is an ID switch, if ON it disables the autosave on map transfer
SAVE_ON_MAP_TRANSFER = 18
#This is an ID switch, if ON it disables the autosave after winning a battle
SAVE_AFTER_WINNING_BATTLE = 19
#This is an ID switch, if ON it disables the autosave after closing Menu
SAVE_AFTER_CLOSING_MENU = 20
############################### END CONFIGURATION ##############################
SAVING_FILE = "Save" + SAVE_NUMBER.to_s() + ".rvdata"
SAVE_NUMBER = 1 if SAVE_NUMBER > NUMBER_OF_SAVE_SLOTS
SAVE_NUMBER = 1 if SAVE_NUMBER < 1
class Auto_Save < Scene_File
def initialize
do_save
end
end
class Scene_File < Scene_Base
alias auto_save_bulletxt_initialize initialize
def initialize(saving, from_title, from_event)
auto_save_bulletxt_initialize(saving, from_title, from_event)
@saving_inside_menu = false
end
def start
super
@file_max = NUMBER_OF_SAVE_SLOTS
create_menu_background
@help_window = Window_Help.new
create_savefile_windows
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
end
@savefile_windows[@index].selected = true
@page_file_max = ((416 - @help_window.height) / 90).truncate
for i in 0...@file_max
window = @savefile_windows[i]
if @index > @page_file_max - 1
if @index < @file_max - @page_file_max - 1
@top_row = @index
window.y -= @index * window.height
elsif @index >= @file_max - @page_file_max
@top_row = @file_max - @page_file_max
window.y -= (@file_max - @page_file_max) * window.height
else
@top_row = @index
window.y -= @index * window.height
end
end
window.visible = (window.y >= @help_window.height and
window.y < @help_window.height + @page_file_max * window.height)
end
end
#create window slots
def create_savefile_windows
@top_row = 0
@savefile_windows = []
for i in 0..(NUMBER_OF_SAVE_SLOTS - 1)
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
@item_max = NUMBER_OF_SAVE_SLOTS
end
#handle going down
def cursor_down(wrap)
@file_max = NUMBER_OF_SAVE_SLOTS
if @index < @file_max - 1 or wrap
@index = (@index + 1) % @file_max
for i in 0...@file_max
window = @savefile_windows[i]
if @index == 0
@top_row = 0
window.y = @help_window.height + i % @file_max * window.height
elsif @index - @top_row > @page_file_max - 1
window.y -= window.height
end
window.visible = (window.y >= @help_window.height and
window.y < @help_window.height + @page_file_max * window.height)
end
if @index - @top_row > @page_file_max - 1
@top_row += 1
end
end
end
#handle going up
def cursor_up(wrap)
@file_max = NUMBER_OF_SAVE_SLOTS
if @index > 0 or wrap
@index = (@index - 1 + @file_max) % @file_max
for i in 0...@file_max
window = @savefile_windows[i]
if @index == @file_max - 1
@top_row = @file_max - @page_file_max
window.y = @help_window.height + i % @file_max * window.height
window.y -= (@file_max - @page_file_max) * window.height
elsif @index - @top_row < 0
window.y += window.height
end
window.visible = (window.y >= @help_window.height and
window.y < @help_window.height + @page_file_max * window.height)
end
if @index - @top_row < 0
@top_row -= 1
end
end
end
alias auto_save_bulletxt_determine_savefile determine_savefile
def determine_savefile
#if true, player has selected autosave slot so he must not save
if @savefile_windows[@index].filename == SAVING_FILE
saving_not_allowed if @saving
return if @saving
end
#if here player can save
@saving_inside_menu = true if @saving
auto_save_bulletxt_determine_savefile
end
#window warning player can't save on auto save slot
def saving_not_allowed
Sound.play_buzzer
b = Bitmap.new(340,60)
b.draw_text(0, 20,340, 20, "Non puoi salvare nello slot Auto Salv.")
w = Window_Message.new
w.contents = b
w.width = 380
w.height = 100
w.visible = true
w.openness = 255
w.x = 100
w.y = 180
w.back_opacity = 255
w.opacity = 255
w.update
Graphics.wait(180)
b.dispose
w.dispose
w = nil
b = nil
end
def do_save
#if true, player is saving from inside menu
if @saving_inside_menu
file = File.open(@savefile_windows[@index].filename, "wb")
else
#if here player has done a manual Auto_Save.new call from event
file = File.open(SAVING_FILE, "wb")
end
write_save_data(file)
file.close
return_scene if @saving_inside_menu
#$scene = Scene_Map.new if @saving_inside_menu == false
@saving_inside_menu = false
end
end
class Scene_Battle < Scene_Base
#save after winning a battle
alias auto_save_bulletxt_process_victory process_victory
def process_victory
auto_save_bulletxt_process_victory
Auto_Save.new if $BTEST == false && $game_switches[SAVE_AFTER_WINNING_BATTLE] == false
end
end
class Scene_Map < Scene_Base
#save on map transfer
alias auto_save_bulletxt_update_transfer_player update_transfer_player
def update_transfer_player
return unless $game_player.transfer?
auto_save_bulletxt_update_transfer_player
Auto_Save.new if $game_switches[SAVE_ON_MAP_TRANSFER] == false
end
end
class Scene_Menu < Scene_Base
#save when exiting menu
alias auto_save_bulletxt_update_command_selection update_command_selection
def update_command_selection
if Input.trigger?(Input::B)
Auto_Save.new if $game_switches[SAVE_AFTER_CLOSING_MENU] == false
end
auto_save_bulletxt_update_command_selection
end
end
class Window_SaveFile < Window_Base
def initialize(file_index, filename)
super(0, 56 + file_index % NUMBER_OF_SAVE_SLOTS * 90, 544, 90)
@file_index = file_index
@filename = filename
load_gamedata
refresh
@selected = false
end
#change autoslave slot string "File $n"
def refresh
self.contents.clear
self.contents.font.color = normal_color
name = Vocab::File + " #{@file_index + 1}" if @file_index != SAVE_NUMBER - 1
self.contents.draw_text(4, 0, 200, WLH, name)
@name_width = contents.text_size(name).width
@autosaveslot = "Autosalvataggio"
self.contents.draw_text(6, 0, 200, WLH, @autosaveslot) if @file_index == SAVE_NUMBER - 1
if @file_exist
draw_party_characters(152, 58)
draw_playtime(0, 34, contents.width - 4, 2)
end
end
#handle cursor width when going on autosave slot
def update_cursor
if @selected
self.cursor_rect.set(0, 0, @name_width + 8, WLH) if @file_index != SAVE_NUMBER - 1
self.cursor_rect.set(0, 0, 140, WLH) if @file_index == SAVE_NUMBER - 1
else
self.cursor_rect.empty
end
end
end
Miglior Esplicazione del Progetto nel Cover Contest http://www.rpg2s.net/cover_contest/icons/cc_special.png Secondo posto allo Screen Contest #58 http://rpg2s.net/gif/SCContest2Oct.gif Secondo posto allo Screen Contest #59 http://rpg2s.net/gif/SCContest2Oct.gif Terzo posto allo Screen Contest #68 http://rpg2s.net/gif/SCContest3Oct.gif
Question
Raxas_Alice
Salve a tutti, stavo lavorando su un progettino -sono ancora all'intro- e ho tra gli script quelli della visualizzazione degli oggetti trovato qui e uno dell'autosave di BulleXt.
Il problema sta che pare siano impatibili, in quanto se provo ad aprire l'autosalvataggio mi da un errore di "IO needed" nello script per gli oggetti. Volevo sapere se qualcuno magari riusciva a capire come mai o se poteva renderli compatibili ^^"
Io posto quello dell'autosave, così per ogni evenienza.
Avviso che non vi erano salvataggi antecedenti all'inserimento di entrambi gli script
=begin AutoSave VX Author: BulleXt(bulletxt@gmail.com) Version: 0.1 Date: 06/07/2009 Description: This script by default will automatically save when you do a map transfer, after winning a battle and after exiting menu. You can also manually call an autosave inside an event by simply doing a call script like this: Auto_Save.new The script doesn't disable normal saving system so player can still save on his slots, he will not be able to overwrite the autosave slot. The script also lets you set how many saving slots you want. =end #This is the autosave slot number SAVE_NUMBER = 1 #this is the number of how many saving slots you want NUMBER_OF_SAVE_SLOTS = 10 #This is an ID switch, if ON it disables the autosave on map transfer SAVE_ON_MAP_TRANSFER = 18 #This is an ID switch, if ON it disables the autosave after winning a battle SAVE_AFTER_WINNING_BATTLE = 19 #This is an ID switch, if ON it disables the autosave after closing Menu SAVE_AFTER_CLOSING_MENU = 20 ############################### END CONFIGURATION ############################## SAVING_FILE = "Save" + SAVE_NUMBER.to_s() + ".rvdata" SAVE_NUMBER = 1 if SAVE_NUMBER > NUMBER_OF_SAVE_SLOTS SAVE_NUMBER = 1 if SAVE_NUMBER < 1 class Auto_Save < Scene_File def initialize do_save end end class Scene_File < Scene_Base alias auto_save_bulletxt_initialize initialize def initialize(saving, from_title, from_event) auto_save_bulletxt_initialize(saving, from_title, from_event) @saving_inside_menu = false end def start super @file_max = NUMBER_OF_SAVE_SLOTS create_menu_background @help_window = Window_Help.new create_savefile_windows if @saving @index = $game_temp.last_file_index @help_window.set_text(Vocab::SaveMessage) else @index = self.latest_file_index @help_window.set_text(Vocab::LoadMessage) end @savefile_windows[@index].selected = true @page_file_max = ((416 - @help_window.height) / 90).truncate for i in 0...@file_max window = @savefile_windows[i] if @index > @page_file_max - 1 if @index < @file_max - @page_file_max - 1 @top_row = @index window.y -= @index * window.height elsif @index >= @file_max - @page_file_max @top_row = @file_max - @page_file_max window.y -= (@file_max - @page_file_max) * window.height else @top_row = @index window.y -= @index * window.height end end window.visible = (window.y >= @help_window.height and window.y < @help_window.height + @page_file_max * window.height) end end #create window slots def create_savefile_windows @top_row = 0 @savefile_windows = [] for i in 0..(NUMBER_OF_SAVE_SLOTS - 1) @savefile_windows.push(Window_SaveFile.new(i, make_filename(i))) end @item_max = NUMBER_OF_SAVE_SLOTS end #handle going down def cursor_down(wrap) @file_max = NUMBER_OF_SAVE_SLOTS if @index < @file_max - 1 or wrap @index = (@index + 1) % @file_max for i in 0...@file_max window = @savefile_windows[i] if @index == 0 @top_row = 0 window.y = @help_window.height + i % @file_max * window.height elsif @index - @top_row > @page_file_max - 1 window.y -= window.height end window.visible = (window.y >= @help_window.height and window.y < @help_window.height + @page_file_max * window.height) end if @index - @top_row > @page_file_max - 1 @top_row += 1 end end end #handle going up def cursor_up(wrap) @file_max = NUMBER_OF_SAVE_SLOTS if @index > 0 or wrap @index = (@index - 1 + @file_max) % @file_max for i in 0...@file_max window = @savefile_windows[i] if @index == @file_max - 1 @top_row = @file_max - @page_file_max window.y = @help_window.height + i % @file_max * window.height window.y -= (@file_max - @page_file_max) * window.height elsif @index - @top_row < 0 window.y += window.height end window.visible = (window.y >= @help_window.height and window.y < @help_window.height + @page_file_max * window.height) end if @index - @top_row < 0 @top_row -= 1 end end end alias auto_save_bulletxt_determine_savefile determine_savefile def determine_savefile #if true, player has selected autosave slot so he must not save if @savefile_windows[@index].filename == SAVING_FILE saving_not_allowed if @saving return if @saving end #if here player can save @saving_inside_menu = true if @saving auto_save_bulletxt_determine_savefile end #window warning player can't save on auto save slot def saving_not_allowed Sound.play_buzzer b = Bitmap.new(340,60) b.draw_text(0, 20,340, 20, "Non puoi salvare nello slot Auto Salv.") w = Window_Message.new w.contents = b w.width = 380 w.height = 100 w.visible = true w.openness = 255 w.x = 100 w.y = 180 w.back_opacity = 255 w.opacity = 255 w.update Graphics.wait(180) b.dispose w.dispose w = nil b = nil end def do_save #if true, player is saving from inside menu if @saving_inside_menu file = File.open(@savefile_windows[@index].filename, "wb") else #if here player has done a manual Auto_Save.new call from event file = File.open(SAVING_FILE, "wb") end write_save_data(file) file.close return_scene if @saving_inside_menu #$scene = Scene_Map.new if @saving_inside_menu == false @saving_inside_menu = false end end class Scene_Battle < Scene_Base #save after winning a battle alias auto_save_bulletxt_process_victory process_victory def process_victory auto_save_bulletxt_process_victory Auto_Save.new if $BTEST == false && $game_switches[SAVE_AFTER_WINNING_BATTLE] == false end end class Scene_Map < Scene_Base #save on map transfer alias auto_save_bulletxt_update_transfer_player update_transfer_player def update_transfer_player return unless $game_player.transfer? auto_save_bulletxt_update_transfer_player Auto_Save.new if $game_switches[SAVE_ON_MAP_TRANSFER] == false end end class Scene_Menu < Scene_Base #save when exiting menu alias auto_save_bulletxt_update_command_selection update_command_selection def update_command_selection if Input.trigger?(Input::B) Auto_Save.new if $game_switches[SAVE_AFTER_CLOSING_MENU] == false end auto_save_bulletxt_update_command_selection end end class Window_SaveFile < Window_Base def initialize(file_index, filename) super(0, 56 + file_index % NUMBER_OF_SAVE_SLOTS * 90, 544, 90) @file_index = file_index @filename = filename load_gamedata refresh @selected = false end #change autoslave slot string "File $n" def refresh self.contents.clear self.contents.font.color = normal_color name = Vocab::File + " #{@file_index + 1}" if @file_index != SAVE_NUMBER - 1 self.contents.draw_text(4, 0, 200, WLH, name) @name_width = contents.text_size(name).width @autosaveslot = "Autosalvataggio" self.contents.draw_text(6, 0, 200, WLH, @autosaveslot) if @file_index == SAVE_NUMBER - 1 if @file_exist draw_party_characters(152, 58) draw_playtime(0, 34, contents.width - 4, 2) end end #handle cursor width when going on autosave slot def update_cursor if @selected self.cursor_rect.set(0, 0, @name_width + 8, WLH) if @file_index != SAVE_NUMBER - 1 self.cursor_rect.set(0, 0, 140, WLH) if @file_index == SAVE_NUMBER - 1 else self.cursor_rect.empty end end endhttp://fc01.deviantart.net/fs71/f/2014/092/2/f/shtbanner_by_flaminiakennedy-d7cq8qm.png http://www.freankexpo.net/signature/697.png
Miglior Esplicazione del Progetto nel Cover Contest
http://www.rpg2s.net/cover_contest/icons/cc_special.png
Secondo posto allo Screen Contest #58
http://rpg2s.net/gif/SCContest2Oct.gif
Secondo posto allo Screen Contest #59
http://rpg2s.net/gif/SCContest2Oct.gif
Terzo posto allo Screen Contest #68
http://rpg2s.net/gif/SCContest3Oct.gif
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now