Jump to content
Rpg²S Forum

Darkshiva

Utenti
  • Posts

    500
  • Joined

  • Last visited

Posts posted by Darkshiva

  1. Descrizione:
    Modifica radicalmente il save_system già esietente.
    Per chi volesse la versione originale(lingua francese)chiedetela.

    Autore:
    Samarium;
    Tradotto tutto da me

    Istruzzioni per l'uso:
    Copiate tutti gli script che contengono * nel vostro progetto e poi per personalizzarlo con le immagini e le windowskin andare li dove ce scritto "Definire immagini" mettete i vostri parametri.
    In fine per richiamare lo script fare come il sistema vecchio.

    Screen:


    Script:

     

     

    =begin
    #------------------------------------------------------------------------
    #                     Menu Sauvegarde amélioréee
    #                               RPG Maker XP
    #
    # Auteur : Samarium
    #
    # Créé le  14 Mai 2008
    #
    #
    # Fonction :  Permet d'améliorer le menu sauvegarde. Il est possible de supprimer
    #             une sauvegarde. Un message de confirmation pour remplacer 
    #             ou effacer est présent aussi.
    #
    # Site : www.rpgcreative.net
    #
    # Remarque : Script disponible aussi sous RPG Maker VX
    #
    #------- Modification ---------
    #
    #------------------------------------------------------------------------
    # N'oubliez pas de mettre avant le script "Main" :
    
    class Scene_Load < Scene_File  
      def scene
        return 0
      end
    end
    class Scene_Save < Scene_File  
      def scene
        return 1
      end
      def on_decision(filename)
        $game_system.se_play($data_system.save_se)
        file = File.open(filename, "wb")
        write_save_data(file)
        file.close
      end
    end
    
    #------------------------------------------------------------------------
    =end
    
    module AM_SAVE
    
    #--------------------------------------------------------
    #                 Définissez les images
    #--------------------------------------------------------
      
      GAUGE_EXP       = "015-Greens01" # Image pour la gauge d'expérience
      GAUGE_HP        = "014-Reds01"   # Image pour la gauge de points de vie
      GAUGE_SP        = "013-Blues01"  # Image pour la gauge de poins de magie
      FOND_GAUGE      = "Back2"        # Fond des jauges
      WINDOWSKIN_BIS = "001-Blue01"          # Windowskin lorsqu'il y a un slot utilisé
      FOND            = "fond_save"    # Arrière plan
      
      # La constante ci-dessous permet d'inverser les windowskins. Si vous mettez
      # "true", le "WINDOWSKIN_BIS" de ci-dessus sera appliqué seulement aux slots
      # de sauvegardes vides. Sinon, si vous mettez "false", ça sera le windowskin par défaut
      # qui sera appliqué aux slot vides
      INVERSE_WINDOWSKIN = false
      
    end
    
    #--------------------------------------------------------
    #             Module Files (Crée par Samarium)
    #       Ce module permetrra de prendre toutes les
    #               données du fichier rxdata
    #--------------------------------------------------------
    
    module Files
      class Donnees
        # Index du fichier
        attr_accessor :file_index
        # Donnée de la classe File
        attr_reader :time_stamp
        # Donées du ficher rxdata
        attr_reader :characters
        attr_reader :frame_count
        attr_reader :system
        attr_reader :switches
        attr_reader :variables
        attr_reader :self_switches
        attr_reader :screen
        attr_reader :actors
        attr_reader :party
        attr_reader :troop
        attr_reader :map
        attr_reader :player
        def initialize(file_index = 0)
          @file_index = file_index
          if exist?  
            file = File.open(filename, "r")
            @time_stamp         = file.mtime
            @characters         = Marshal.load(file)
            @frame_count        = Marshal.load(file)
            @system             = Marshal.load(file)
            @switches           = Marshal.load(file)
            @variables          = Marshal.load(file)
            @self_switches      = Marshal.load(file)
            @screen             = Marshal.load(file)
            @actors             = Marshal.load(file)
            @party              = Marshal.load(file)
            @troop              = Marshal.load(file)
            @map                = Marshal.load(file)
            @player             = Marshal.load(file)
            file.close
          end
        end
        def exist?
          return FileTest.exist?(filename)
        end
        def filename
          return "Save#{file_index + 1}.rxdata"
        end
      end  
    end
    
    #--------------------------------------------------------
    #              Window_SaveFile modifié
    #             Les fenêtres pour les slots
    #--------------------------------------------------------
    
    class Window_SaveFile < Window_Base
      
      attr_reader   :selected                 
     
      def initialize(file_index, filename = nil)
        super(15, 64 + file_index % 4 * 85, 130, 80)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
        @opacity = 80
        self.opacity = @opacity
        @file_index = file_index
        # Charge les données du fichier.
        @game = Files::Donnees.new(file_index)
    
        refresh
        @selected = false
      end
      
      def refresh
        self.contents.clear
        self.contents.font.size = 18
        name = "Slot #{@file_index + 1}"
        self.contents.font.color = normal_color
      # name = "File #{@file_index + 1}"
        self.contents.draw_text(0, 0, 600, 32, name)
        # Si il y a déjà une sauvegarde
       
        
        if @game.exist?
          @game = Files::Donnees.new(@file_index)
           windowskin = AM_SAVE::INVERSE_WINDOWSKIN ? AM_SAVE::WINDOWSKIN_BIS : $game_system.windowskin_name 
          self.windowskin = RPG::Cache.windowskin(windowskin)
          text = @game.time_stamp.strftime("%d/%m/%Y %H:%M")
        else
           windowskin = AM_SAVE::INVERSE_WINDOWSKIN ? $game_system.windowskin_name : AM_SAVE::WINDOWSKIN_BIS
          self.windowskin = RPG::Cache.windowskin(windowskin)
           text = "Vide"
        end
        self.contents.font.size = 15
        self.contents.font.color = normal_color
        self.contents.draw_text(0, 25, 600, 32, text)
      end
      def selected=(selected)
        @selected = selected
        update_cursor_rect
      end
      # Défini l'opacité et positionnement du slot lorsque ce dernier est sélectionné
      def update_cursor_rect
        if @selected
          self.opacity = 255
          self.x = 30
        else
          self.opacity = @opacity
          self.x = 15
        end
      end
    end
    
    #--------------------------------------------------------
    #               Window_SaveStatus
    #   Fenêtre avec les indications des héros (PV, MP ...)
    #--------------------------------------------------------
    
    class Window_FileStatus < Window_Base
      
      def initialize
        super(640, 80, 440, 300)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
        self.contents.font.size = 15
        self.opacity = 150
        refresh
      end
      def refresh(file_index=0)
          self.contents.clear
           @game = Files::Donnees.new(file_index)
          if @game.exist?
            # Affiche en boucle les héros
            for i in 0...@game.characters.size
              # Algorithme pour afficher 2 héros sur 2 colonnes 
              x = i < 2 ? 64 : 270
              j = (i == 2  or i == 0) ? 0 : j+1
              y = j * 135
              # Affichage des caractéristiques
              actor = @game.party.actors[i] 
              draw_actor_name(actor, x, y)
              draw_actor_graphic(actor, x - 40, y + 80)
      #       draw_actor_class(actor, x + 144, y)
              draw_actor_level(actor, x, y + 16)
              draw_actor_state(actor, x + 60, y + 16)
              draw_actor_exp(actor, x, y + 40)
              draw_actor_hp(actor, x , y + 60)
              draw_actor_sp(actor, x, y + 80)
            end
          end
        end
      # Permet de faire bouger vers la gauche la fenêtre
      def bouger
        self.x -= 50 if self.x >= 220 if @game.exist?
        return true if self.x <= 220
      end
      # permet de retirer la fenêtre de l'écran
       def retirer
        self.x += 50 if self.x <= 640 if @game.exist?
        return true if self.x >= 640
      end
      # Déssine une jauge
      def draw_gauge(x, y, min, max, file, width, height)
        pourcentage = max == 0 ? 0 : min.to_f / max.to_f
        gauge = RPG::Cache.picture(file)
        fond = RPG::Cache.picture(AM_SAVE::FOND_GAUGE)
        gauge_dest = Rect.new(x, y, width * pourcentage, gauge.height)
        fond_dest = Rect.new(x, y,width, fond.height)
        gauge_source = Rect.new(0,0, gauge.width, gauge.height)
        fond_source = Rect.new(0,0, fond.width,fond.height)
        self.contents.stretch_blt(fond_dest, fond, fond_source)
        self.contents.stretch_blt(gauge_dest, gauge, gauge_source)
      end  
     # Reprise de la méthode de Window_Base en affichant la jauge d'expérience
      def draw_actor_exp(actor, x, y)
        min = actor.level == 99 ? 1 : actor.exp_s
        max = actor.level == 99 ? 1 : actor.next_exp_s
        draw_gauge(x + 32, y + 16, min, max,AM_SAVE::GAUGE_EXP, 80, 8)
        if actor.level == 99
          self.contents.draw_text(x + 33, y, 600, 32, "-----/-----")
        else
          self.contents.draw_text(x + 33, y, 600, 32, min.to_s + "/" + max.to_s)
        end
        self.contents.font.color = system_color
        self.contents.draw_text(x, y, 32, 32, "Exp")
       end
      # Reprise de la méthode de Window_Base en affichant la jauge de PV
      def draw_actor_hp(actor, x, y, width=144)
        draw_gauge(x + 32, y + 16,actor.hp , actor.maxhp,AM_SAVE::GAUGE_HP, 80, 8)
        self.contents.font.color = system_color
        self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
          if width - 32 >= 108
          hp_x = x + width - 138
          flag = true
        elsif width - 32 >= 48
          hp_x = x + width - 88
          flag = false
        end
        self.contents.font.color = actor.hp == 0 ? knockout_color :
          actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
        self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
        if flag
          self.contents.font.color = normal_color
          self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
          self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
        end
      end
      # Reprise de la méthode de Window_Base en affichant la jauge de MP
      def draw_actor_sp(actor, x, y, width = 144)
        draw_gauge(x + 32, y + 16,actor.sp , actor.maxsp,AM_SAVE::GAUGE_SP, 80, 8)
        self.contents.font.color = system_color
        self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
        if width - 32 >= 108
         sp_x = x + width - 138
          flag = true
        elsif width - 32 >= 48
          sp_x = x + width - 88
          flag = false
        end
        self.contents.font.color = actor.sp == 0 ? knockout_color :
          actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
        self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
        if flag
          self.contents.font.color = normal_color
          self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
          self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
        end
      end
    end
    
    #--------------------------------------------------------
    #                   Window_FileInfo
    #     Fenêtre avec les infos du jeu en bas de l'écran
    #--------------------------------------------------------
    
    class Window_FileInfo < Window_Base
      
      def initialize
        super(-4, 480, 681, 80)
        self.contents = Bitmap.new(width, height)
        self.contents.font.name = $fontface
        self.contents.font.color = normal_color 
        self.opacity = 150
        
        refresh
      end
      
      def refresh(file_index = 0)
        self.contents.clear
        @game = Files::Donnees.new(file_index)
        if @game.exist?
           self.contents.font.size = 20
          @total_sec = @game.frame_count / Graphics.frame_rate
          cx = contents.text_size($data_system.words.gold).width
          cgold = contents.text_size(@game.party.gold.to_s).width
          # Affiche argent possédé, sauvegardes effetués et temps joué
          self.contents.draw_text(4, 0, 130, 32, "Argent possédé :")
          self.contents.draw_text(140, 0, 120-cx-2, 32, @game.party.gold.to_s)
          self.contents.draw_text(142 + cgold, 0, cx, 32, $data_system.words.gold)
          self.contents.draw_text(250, 0, 300, 32, "Sauvegardes effectuées : " + @game.system.save_count.to_s) 
          hour = @total_sec / 60 / 60
          min = @total_sec / 60 % 60
          sec = @total_sec % 60
          time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
          self.contents.draw_text(4, 20, 100, 32, "Temps joué : ")
          self.contents.draw_text(140, 20, 100, 32, time_string)
          self.contents.font.size = 16
          self.contents.draw_text(370, 20, 400, 32, "Appuyez sur Z pour effacer une sauvegarde")
        end
      end
     # permet de faire bouger la fenêtre vers le haut 
      def bouger
        self.y -= 10 if self.y > 420 if @game.exist?
      end
    end
    
    #--------------------------------------------------------
    #                   Window_FileConfirm
    #              Fenêtre pour les confirmations
    #--------------------------------------------------------
    
    class Window_FileConfirm < Window_Selectable
      
       attr_reader :type
    
      def initialize
        super(640, 160, 410, 130)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.name = $fontface
        self.contents.font.size = 20
        refresh
        self.active = false
        self.opacity = 150
        @type = 0
      end
     # Affiche des phrases de confirmation selon le type choisit
      def refresh(type = 0)
        self.contents.clear
        @type = type
        self.index = 1
        if type == 0
          self.contents.draw_text(0, 10, 410, 32, "Il existe déjà une sauvegarde à cet emplacement.", 1)
          self.contents.draw_text(50, 32, 300, 32, "Etes vous sûr de la remplacer ?", 1)
        elsif type == 1
          self.contents.draw_text(50, 20, 300, 32, "Etes vous sûr de la supprimer ?", 1)
        elsif type == 2
           self.index = -1
           self.contents.draw_text(0, 40, 400, 32, "Le fichier a été supprimé avec succès", 1)
        elsif type == 3 or type == 4
           self.index = -1
           self.contents.draw_text(0, 40, 400, 32, "Jeu sauvegardé avec succès", 1)   
         end
         # Sélection du "Oui" ou "Non"
        if type != 2 and type != 3 and type != 4
          self.contents.draw_text(110, 70, 50, 32, "Oui", 1)
          self.contents.draw_text(220, 70, 50, 32, "Non", 1)
        end
      end
    
      def update_cursor_rect
        if @index < 0
          self.cursor_rect.empty
        else
          self.cursor_rect.set(110 * @index, 70, 50, 32)
        end
      end
      # Bouge la fenêtre vers la gauche
      def bouger
       self.x -= 50 if self.x >= 220
       return true if self.x <= 220     
     end
      # Retire la fenêtre
      def retirer
       self.x += 50 if self.x <= 640
       return true if self.x >= 640
      end 
    end
    
    #--------------------------------------------------------
    #                   Scene_File modifié
    #           Scene et actions pour les sauvegardes
    #--------------------------------------------------------
    
    class Scene_File
      
      def initialize(help_text)
        @help_text = help_text
      end
      
      def main
        # Initialisation des objets pour les différentes fenêtres
        @help_window = Window_Help.new
        @help_window.set_text(@help_text, 1)   
        @file_status_window = Window_FileStatus.new
        @file_info_window = Window_FileInfo.new
        @confirm_window = Window_FileConfirm.new
        @confirm = false
        @delete = false
        @auto_retirer = false
        # Affichage du fond
        @sprite = Sprite.new
        @sprite.bitmap = RPG::Cache.picture(AM_SAVE::FOND)
        @help_window.opacity = 0
        @savefile_windows = []
        for i in 0..3
          @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
        end
        @file_index = 0
        @savefile_windows[@file_index].selected = true
        # Mise à jour comme toujours
        Graphics.transition
        loop do
          Graphics.update
          Input.update
          update
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @help_window.dispose
        @file_status_window.dispose
        @file_info_window.dispose
        @sprite.dispose
         @confirm_window.dispose
        for i in @savefile_windows
          i.dispose
        end
      end
    
      def update
        # Mise à jour des fenêtres
        @help_window.update
        @file_status_window.update
        @file_info_window.update
        @confirm_window.update
        @sprite.update
        for i in @savefile_windows
          i.update
        end
        # Si la fenêtre de confirmation est active, on affiche la sélection
        if @confirm_window.active
           update_confirm 
        end
        # On bouge la fenêtre d'info
        @file_info_window.bouger
        # Si on demande confirmation
        if @confirm
           # On bouge la fenêtre de confirmation après avoir retirer la fenêtre de Statut
          if @file_status_window.retirer 
             @confirm_window.bouger 
             @confirm_window.active  = true
             save_reussie if @confirm_window.type == 3  if @confirm_window.bouger
          end
        else 
          # Réciproquement ...
          if @confirm_window.retirer
          @file_status_window.bouger  
          @confirm_window.active  = false
        end
      end
        # Si on demande le retirement automatique
        if @auto_retirer
          @auto_retirer = false
          @savefile_windows[@file_index].refresh
          # On affiche pendant 2 secondes
          wait(2) 
         end 
        # Si on appuie sur Entrée
        if Input.trigger?(Input::C)
          # Si c'est pour une confirmation
             if @confirm 
               case @confirm_window.index
               # Annulation
               when 2
               $game_system.se_play($data_system.cancel_se)
               @confirm = false
               return
               # validation
               when 1            
                 case @confirm_window.type
                  when 0  
                    # on sauvegarde
                     on_decision(make_filename(@file_index))
                    save_reussie 
                  when 1
                    # On supprime
                    delete(make_filename(@file_index))
                    @confirm_window.refresh(2)
                    @auto_retirer = true 
                  end
                end
              else
                # Si la scene est "Scene_Save"
                if scene == 1 
                  # Si il existe déjç une sauvegarde
                  if File.exist?(make_filename(@file_index))
                   @confirm_window.refresh
                   # On demande confirmation
                   @confirm = true
                 else
                   # Sinon, on sauvegarde directement
                   on_decision(make_filename(@file_index))
                    @confirm_window.refresh(3)
                    @confirm = true
                   end
                 else
                   # Si la scene est "Scene_Load"
                   on_decision(make_filename(@file_index))
                end
              end
            return
          end
        # Si on appuie sur "Echap" : Annulation
        if Input.trigger?(Input::B)
          # On revient au menu
          if !@confirm
            on_cancel 
          else
            # On enlève la fenêtr de confirmation
            $game_system.se_play($data_system.cancel_se)
            @confirm = false
          end
         return
       end
      # Si on appuie sur "Z"
      if Input.trigger?(Input::A) and File.exist?(make_filename(@file_index))
        # on demande confirmation
         @confirm_window.refresh(1)
         @confirm = true
       return
     end
     # Si on choisit les slots
      if !@confirm
        if Input.repeat?(Input::DOWN)
          if Input.trigger?(Input::DOWN) or @file_index < 3 
            @file_status_window.x = 640
            @file_info_window.y = 480
            $game_system.se_play($data_system.cursor_se)
            @savefile_windows[@file_index].selected = false
            @file_index = (@file_index + 1) % 4
            @savefile_windows[@file_index].selected = true
            # On réfraichit les fenêtres
            @file_status_window.refresh(@file_index)
            @file_info_window.refresh(@file_index)
          return
          end
        end
        if Input.repeat?(Input::UP)
          if Input.trigger?(Input::UP) or @file_index > 0
            @file_status_window.x = 640
            @file_info_window.y = 480
            $game_system.se_play($data_system.cursor_se)
            @savefile_windows[@file_index].selected = false
            @file_index = (@file_index + 3) % 4
            @savefile_windows[@file_index].selected = true
             # On réfraichit les fenêtres
            @file_status_window.refresh(@file_index)
            @file_info_window.refresh(@file_index)
            return
          end
        end
      end  
      end
      # Le nom du fichier
      def make_filename(file_index)
        game = Files::Donnees.new(file_index)
        return game.filename
      end
      # Sélection dans la fenêtre de confirmation
      def update_confirm
        if (Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)) and @confirm_window.index != 1
          $game_system.se_play($data_system.cursor_se)
          @confirm_window.index = 1 
          return
        elsif (Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)) and @confirm_window.index != 2
          $game_system.se_play($data_system.cursor_se)
          @confirm_window.index = 2 
          return
        end
      end
       # Attente (Calcul en secondes)    
       def wait(time)
        total_sec_dep = Graphics.frame_count / Graphics.frame_rate
        loop do
           total_sec = Graphics.frame_count / Graphics.frame_rate
            Graphics.update
            Input.update
            if total_sec >= (total_sec_dep + time)
              @confirm = false
              break
            end
          end
        return
        end
    # Si la sauvegarde est réussie, on éfraichit les fenêtres et on retire automatiquement
     def save_reussie
         @savefile_windows[@file_index].refresh
         @file_status_window.refresh(@file_index)
         @file_info_window.refresh(@file_index)
         @confirm_window.refresh(4)
         @auto_retirer = true
      end
     # Suppression du fichier   
      def delete(filename)
        File.delete(filename)
        @file_info_window.y = 480
      end
    end
    
    

     

     

     

    Demo

    Script tradotto al 99%

    Bug noti:
    N/A

  2. allora io uso solo il tuo script poi l'errore me lo ha dato all'improvviso e poi dopo l'errore aprendo lo script editor mi apre lo script game_temp alla seconda riga(sembrerà strano ma è vero)se vuoi ti do lo scrren dell'errore
  3. Ciao senti, ho messo lo script e poi ho messo l'evento che richiama lo Script però quando lo chiamo non mi si leggono le cose della finestra che si apre. Perchè? :smile:

     

    perchè sleeping ha usato una font diversa da quelle che hai nel pc(sleeping la posteresti la font?)

    comunque sleeping sei sempre il migliore con gli script :rovatfl: :wink: :tongue: :blink: :wink:

  4. LA BOTTEGA DI DARKSHIVA

     

     

     

    Le mie abilità:

    Traduzzione degli script;

    Discreto mapper;

    Modifica di alcuni script.

     

    I miei lavori:

    Traduzione script triple triad

    Modifica script minkoff a 4 pose a quella a 11(pur non sapendo che esisteva quella creata da minkoff)

    Save_system personalizzabile Tradotto da francese a italiano

    Sefrografia tradotta da me

    Pcco di risorse grafiche di naruto per rpg 2k3

     

    Servizi offerti:

    Traduzione script xp ed vx

    Modifica script xp

    Mapper

    creo battler per bs rpg 2k3 da sprites

    creo battler ccoa da sprites

     

    Listino Prezzi:

    3 lavori a 1 rens

     

    Lavori completati:

  5. e già questo è un ottimo script ma ha un piccolo problema........non è compatibile con un sistem_rtab(o qualcosa del genere)sarebbe il sistema di caricamento a stile final fantasy 8 o 12 invece è impostato a turni come final fantasy 10.Per cui mi chiedevo se potevate dirmi se ce un modo per metterlo stile caricamento ff8.Rispondete please!!!!!!!
  6. Salve!!!!sono sempre io a rompe i cesti :biggrin: .....Ma mi serve il battlers rtp standard(per bs standard) di seifer un pg di final fantasy 8.Io non lo trovo da nessuna parte nemmeno sulle immagini di google per cui mi rivolgo a voi.Please aiutatemi!?!?!?!?!
×
×
  • Create New...