Já viram qual a arte dessa semana?Exposição dos Artistas #8
10 Respostas   573 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
#==============================================================================# RMTM AutoSave v 1.0#==============================================================================#------------------------------------------------------------------------------# Créditos: Leon-S.K --- ou --- AndreMaker --- ou --- 4ndreMTM#------------------------------------------------------------------------------# Script de funcionalidade simples que adiciona um sistema de autosave ao# jogo, com direito a icones e som.### Para auto-salvar usando eventos, apenas adicione no evento um comentario# assim : "autosave!"# E o jogo irá salvar no exato ponto onde o comentario foi chamado.## Você pode forçar o jogo a salvar sem que um arquivo exista, usando o# comentário "force_save=x", sendo que x é o index do salvo#------------------------------------------------------------------------------module RMTM #------------------------------------------------------------------------------ # CONFIGURAÇÕES GERAIS #------------------------------------------------------------------------------ module AutoSave # Switch que controla o autosave AutoSave_Switch = 22 # Tempo até o próximo autosave # 0 para desativar AutoSave_Time = 1020 # Som tocado ao executar autosave ( deixe "" para desabilitar) AutoSave_SE = "Decision2" # Icone mostrado ao executar autosave ( deixe "" para desabilitar) # OBS: O nome deve ser o nome do arquivo na pasta Pictures AutoSave_Icon = "autosave" # Coordenada X do icone na tela AutoSave_IconX = 474 # Coordenada Y do icone na tela AutoSave_IconY = 8 # Tempo que o icone irá permanecer na tela AutoSave_Frames = 100 # Animação do Icone # 0 - desativado # 1 - o Icone aumenta gradualmente até sumir # 2 - o Icone aumenta e diminui gradualmente até sumir # 3 - o Icone vai de um lado para o outro até sumir # 4 - o Icone roda até sumir AutoSave_Anim = 4 endendclass Game_System attr_accessor :autosave_enabled attr_accessor :current_loaded_index def autosave return if @autosave_enabled == false if @current_loaded_index.nil? msgbox " Ruby MTM message =[\nAutoSave Error - Disabling AutoSave" $game_switches[RMTM::AutoSave::AutoSave_Switch] = false @autosave_enabled = false return end if DataManager.save_game(@current_loaded_index) if RMTM::AutoSave::AutoSave_Icon != "" SceneManager.scene.spriteset.autosave if SceneManager.scene.is_a?(Scene_Map) end if RMTM::AutoSave::AutoSave_SE != "" RPG::SE.new(RMTM::AutoSave::AutoSave_SE, 80).play end else msgbox " Ruby MTM message =[\nAutoSave Error - Disabling AutoSave" $game_switches[RMTM::AutoSave::AutoSave_Switch] = false @autosave_enabled = false end endendclass Scene_Map < Scene_Base attr_accessor :spritesetendclass Game_Player < Game_Character include RMTM::AutoSave alias :init :initialize def initialize @autosave_timer = 0 init end alias :rmtm_upd :update def update update_autosave rmtm_upd end def update_autosave if $game_system.autosave_enabled != $game_switches[AutoSave_Switch] $game_system.autosave_enabled = $game_switches[AutoSave_Switch] end enabled = $game_system.autosave_enabled return if not enabled unless AutoSave_Time == 0 @autosave_timer += 1 if @autosave_timer > AutoSave_Time @autosave_timer = 0; return end if @autosave_timer == AutoSave_Time $game_system.autosave @autosave_timer = 0 end end endendclass << DataManager alias :rmtm_load_file :load_game def load_game(index) $game_system.current_loaded_index = index rmtm_load_file(index) end alias :rmtm_save_file :save_game def save_game(index) if $game_system.current_loaded_index.nil? $game_system.current_loaded_index = index end rmtm_save_file(index) endendclass Spriteset_Map alias :rmtm_upd :update def update upd_autosave_icon if $game_system.autosave_enabled rmtm_upd end def upd_autosave_icon if @autosave_icon.is_a?(AutoSave_Icon) @autosave_icon.update if @autosave_icon.need_dispose? @autosave_icon.dispose if not @autosave_icon.disposed? @autosave_icon = nil end end end def autosave @autosave_icon = AutoSave_Icon.new(@viewport2) endendclass AutoSave_Icon < Sprite include RMTM::AutoSave def initialize(view) @need_dispose = false super(view) self.z += 50 self.bitmap = Bitmap.new("Graphics/Pictures/#{AutoSave_Icon}") wd,hg = self.bitmap.width / 2, self.bitmap.height / 2 self.ox, self.oy = wd,hg self.x, self.y = AutoSave_IconX + (wd), AutoSave_IconY + (hg) @frames = AutoSave_Frames; @phase = 0; @p_timer = 0 @fader = 0 end def update return if self.disposed? super return if @need_dispose upd_timer upd_anim end def upd_fader if @fader >= (AutoSave_Time / 4).to_i self.opacity -= 3 else @fader += 1 end end def upd_timer if @frames > 0 @frames -= 1 else @need_dispose = true end end def upd_anim upd_fader return if AutoSave_Anim == 0 case AutoSave_Anim when 1 self.zoom_x += 0.003 self.zoom_y += 0.003 when 2 if @phase == 0 @p_timer += 1 self.zoom_x += 0.005 self.zoom_y += 0.005 if @p_timer == 13 @phase = 1 @p_timer = 0 end elsif @phase == 1 @p_timer += 1 self.zoom_x -= 0.005 self.zoom_y -= 0.005 if @p_timer == 13 @phase = 0 @p_timer = 0 end end when 3 self.wave_amp = 3 self.wave_speed = 25 self.wave_length = 2 when 4 self.angle += 5 end end def disposed? super end def dispose super end def need_dispose? @need_dispose endendclass Game_Interpreter def command_108 @comments = [@params[0]] string = @list[@index].parameters[0] if string.downcase == "autosave!" $game_system.autosave elsif string.downcase.start_with?("force_save=") n = string.sub("force_save=","").to_i $game_system.current_loaded_index = n $game_system.autosave end while next_event_code == 408 string = @list[@index].parameters[0] if string.downcase == "autosave!" $game_system.autosave elsif string.downcase.start_with?("force_save=") n = string.sub("force_save=","").to_i $game_system.current_loaded_index = n $game_system.autosave end @index += 1 @comments.push(@list[@index].parameters[0]) end endend
#===============================================================================## DT's Autosave# Author: DoctorTodd# Date (06/22/2012)# Version: (1.0.0) (VXA)# Level: (Simple)# Email: Todd@beacongames.com##===============================================================================## NOTES: 1)This script will only work with ace.##===============================================================================## Description: Saves the game when transferring the map, before battle,# and opening the menu (all optional).## Credits: Me (DoctorTodd)##===============================================================================## Instructions# Paste above main.# Call using Autosave.call##===============================================================================## Free for any use as long as I'm credited.##===============================================================================## Editing begins 37 and ends on 50.##===============================================================================module ToddAutoSaveAce #Max files (without autosave). MAXFILES = 16 #Autosave file name. AUTOSAVEFILENAME = "Autosave" #Autosave before battle? AUTOSAVEBB = true #Autosave when menu opened? AUTOSAVEM = true #Autosave when changing map? AUTOSAVETM = true end#==============================================================================# ** Autosave#------------------------------------------------------------------------------# This module contains the autosave method. This is allows you to use the# "Autosave.call" command.#==============================================================================module Autosave #-------------------------------------------------------------------------- # * Call method #-------------------------------------------------------------------------- def self.call DataManager.save_game_without_rescue(0)endend#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the# global variables used by the game are initialized by this module.#==============================================================================module DataManager #-------------------------------------------------------------------------- # * Maximum Number of Save Files #-------------------------------------------------------------------------- def self.savefile_max return ToddAutoSaveAce::MAXFILES + 1 end end#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Preprocessing for Battle Screen Transition #-------------------------------------------------------------------------- def pre_battle_scene Graphics.update Graphics.freeze @spriteset.dispose_characters BattleManager.save_bgm_and_bgs BattleManager.play_battle_bgm Sound.play_battle_start Autosave.call if ToddAutoSaveAce::AUTOSAVEBBend #-------------------------------------------------------------------------- # * Call Menu Screen #-------------------------------------------------------------------------- def call_menu Sound.play_ok SceneManager.call(Scene_Menu) Window_MenuCommand::init_command_position Autosave.call if ToddAutoSaveAce::AUTOSAVEMend #-------------------------------------------------------------------------- # * Post Processing for Transferring Player #-------------------------------------------------------------------------- def post_transfer case $game_temp.fade_type when 0 Graphics.wait(fadein_speed / 2) fadein(fadein_speed) when 1 Graphics.wait(fadein_speed / 2) white_fadein(fadein_speed) end @map_name_window.open Autosave.call if ToddAutoSaveAce::AUTOSAVETMendend
Assim se tá dando erro, usa outro, esse aqui é ótimo usei em um projeto antigo:Código: [Selecionar]#===============================================================================## DT's Autosave# Author: DoctorTodd# Date (06/22/2012)# Version: (1.0.0) (VXA)# Level: (Simple)# Email: Todd@beacongames.com##===============================================================================## NOTES: 1)This script will only work with ace.##===============================================================================## Description: Saves the game when transferring the map, before battle,# and opening the menu (all optional).## Credits: Me (DoctorTodd)##===============================================================================## Instructions# Paste above main.# Call using Autosave.call##===============================================================================## Free for any use as long as I'm credited.##===============================================================================## Editing begins 37 and ends on 50.##===============================================================================module ToddAutoSaveAce #Max files (without autosave). MAXFILES = 16 #Autosave file name. AUTOSAVEFILENAME = "Autosave" #Autosave before battle? AUTOSAVEBB = true #Autosave when menu opened? AUTOSAVEM = true #Autosave when changing map? AUTOSAVETM = true end#==============================================================================# ** Autosave#------------------------------------------------------------------------------# This module contains the autosave method. This is allows you to use the# "Autosave.call" command.#==============================================================================module Autosave #-------------------------------------------------------------------------- # * Call method #-------------------------------------------------------------------------- def self.call DataManager.save_game_without_rescue(0)endend#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the# global variables used by the game are initialized by this module.#==============================================================================module DataManager #-------------------------------------------------------------------------- # * Maximum Number of Save Files #-------------------------------------------------------------------------- def self.savefile_max return ToddAutoSaveAce::MAXFILES + 1 end end#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Preprocessing for Battle Screen Transition #-------------------------------------------------------------------------- def pre_battle_scene Graphics.update Graphics.freeze @spriteset.dispose_characters BattleManager.save_bgm_and_bgs BattleManager.play_battle_bgm Sound.play_battle_start Autosave.call if ToddAutoSaveAce::AUTOSAVEBBend #-------------------------------------------------------------------------- # * Call Menu Screen #-------------------------------------------------------------------------- def call_menu Sound.play_ok SceneManager.call(Scene_Menu) Window_MenuCommand::init_command_position Autosave.call if ToddAutoSaveAce::AUTOSAVEMend #-------------------------------------------------------------------------- # * Post Processing for Transferring Player #-------------------------------------------------------------------------- def post_transfer case $game_temp.fade_type when 0 Graphics.wait(fadein_speed / 2) fadein(fadein_speed) when 1 Graphics.wait(fadein_speed / 2) white_fadein(fadein_speed) end @map_name_window.open Autosave.call if ToddAutoSaveAce::AUTOSAVETMendend
Eae blz?Bem, faz tempo que não mexo com RGSS3, mas vou tentar te ajudar. Acho que sei oque é o problema, mas não vou falar antes de ter certeza (vai que piora as coisas).Poderia me passar o link do post com esse script? quero confirmar 1 coisa antes de dizer oque eu vi de errado ;x
msgbox "Erro 1\n Ruby MTM message =[\nAutoSave Error - Disabling AutoSave"
Difícil saber porque você não deu detalhes de quando e como ocorre o problema. Testei aqui e não consegui reproduzir esse erro então o jeito é fazer uma verificação simples para tentar deduzir a causa:1) A mensagem de erro que você recebe é do próprio script, ou seja ele está encontrando alguma condição que interrompe sua própria execução;2) Se você reparar no script essa mensagem de erro está presente em dois lugares (linhas 65 e 78), logo você precisa saber qual das duas é a que está te sendo mostrada;3) Edite uma dessas mensagens (ou as duas se quiser) colocando um indicador que possa te fazer diferenciar ambas.Exemplo que fiz aqui:Código: [Selecionar]msgbox "Erro 1\n Ruby MTM message =[\nAutoSave Error - Disabling AutoSave"4) Abra o jogo e verifique qual mensagem de erro lhe está sendo mostrada, se a da linha 65 ou a da linha 78.Sem isso só posso recomendar que experimente usar o save normal para ver se ele está funcionando. Também nunca deixe de verificar se não ocorre incompatibilidade com scripts que já usa no seu projeto. o/
Você ainda não disse as informações mais importantes: Já testou o script em um projeto em branco? O problema acontece tanto indo via Novo Jogo quanto pelo Continuar ou só em um dos casos?A primeira mensagem de erro eu até consegui reproduzir, mas essa segunda aí não consegui ver não. Do jeito que você mostrou aí no tópico eu testei aqui sem verificar problemas, note que sequer tenho a demo original desse script e ainda assim me foi possível usá-lo sem problemas. Não parece ser problema do script, mas de como você o está usando e com o que está usando. :será: