Jump to content
Rpg²S Forum

raffy2010

Utenti
  • Posts

    81
  • Joined

  • Last visited

Posts posted by raffy2010

  1. Sono finalmente tornato su questo forum che da ragazzino amavo alla follia. L'ho trovato molto cambiato sia dal punto di vista grafico sia per i tantissimi tool che sono stati aggiunti.

    Da piccolo avevo tanto tempo ma non avevo le competenze per scriptare, adesso ho le competenze ma non il tempo xD

  2. Mmm... Ho dato un'occhiata allo script ma al momento non riesco a vedere l'errore. Ti do una bella checklist di controlli che puoi fare:

    • Controlla che il file abbia estensione .ogg (scaricare un file bgm.mp3 e rinominarlo in bgm.ogg non è una conversione)
    • Controlla se RPG Maker riproduce in modo corretto l'audio dalla GUI. Prova ad esempio a mettere quel bgm che vuoi suonare nel menù in una mappa
    • Controlla se hai scritto bene il nome del file (ma credo di sì perché sono abbastanza sicuro che altrimenti crasherebbe)

    Se nessuno dei metodi funziona prova a cerca questa linea:

    Sound.play_bgm_worldmap if DAI::WORLDMAP::BGM_ENABLED

    E sostituiscila con

    Sound.play_bgm_worldmap

    EDIT: Se ancora non dovesse funzionare cerchiamo di debuggare insieme

  3.  

    On 11/3/2024 at 7:59 PM, nickk.c said:

    Ciao a tutti, vorrei chiedere se è possibile modificare questo script in modo tale da poter cambiare durante il gioco sia l'immagine della mappa del mondo che il BGM. Grazie in anticipo :D

    Ciao,

    al momento non posso testare il codice, ma ho preparato una modifica che dovrebbe permetterti di cambiare sia l'immagine della mappa del mondo (World Map) che la musica di sottofondo (BGM) durante il gioco. Fammi sapere se funziona o se riscontri qualche errore.

    Spoiler
    =begin
    --------------------------------------------------------------------------------
     DNI IMAGE WORLD MAP SYSTEM
     Author: DaiNekoIchi (Dai Ichi)
     Site: http://dainekoichi.blogspot.com/
     Version: 1.0
     
     Please give credit if used~!
    --------------------------------------------------------------------------------
     Updates:
      2015.10.13 - V1.0
      2015.10.11 - Started script
    --------------------------------------------------------------------------------
     Introduction:
      This script recreates a world map system that uses an image file. Users can
      define locations(map points). This also features a 'fast travel' menu for
      those who feel that moving around with a cursor is dragging and boring.
    --------------------------------------------------------------------------------
     Instructions:
      From RPG Maker VX Ace...
      1.) Press F11 or Tools -> Script Editor...
      2.) Copy/paste this script to an open slot blow  Materials and above  Main
      3.) Save.
    --------------------------------------------------------------------------------
     Usage Ingame:
      - When the scene is called, press the directional keys to move around.
      - For fast travel (if enabled), press A (Shift)
    --------------------------------------------------------------------------------
     Script Calls:
      - To call the World Map scene, use the following script:
        > call_worldmap('location_name')
        ...replace location_name with the actual location name (from the map points)
        
      - To unlock/enable/disable a location, use the following scripts:
        > unlock_location('location_name')
        > enable_location('location_name')
        > disable_location('location_name')
        Optionally, you can unlock a location in a disabled state:
        > unlock_location('location_name',false)
    
      - You can also check if a location is unlocked or enabled:
        > location_unlocked?('location_name')
        > location_enabled?('location_name')
        
      - To change the World Map picutre, use the following script:
        > change_world_map_image("picture")
    --------------------------------------------------------------------------------
     Compatibility:
      This should be compatible with almost all other scripts. Contact me if there
      are any problems.
    --------------------------------------------------------------------------------
     Terms and Conditions:
      This script cannot be reposted in other places without permission.
      Give credit if this script is used in your game.
      Free for non-commercial use. NOT YET AVAILABLE for commercial use.
    --------------------------------------------------------------------------------
    =end
    $current_world_map = 0
    $imported = {} if $imported.nil?
    $imported["Dai-WorldMap"] = true
    
    #===============================================================================
    # [CONFIG START] LET THE CONFIGURATION BEGIN!
    #===============================================================================
    module DAI
      module WORLDMAP
        #---------------------------------------------------------------------------
        # CURSOR_IMAGE: The image file of the cursor
        # CURSOR_ORIGIN: The point of origin of your cursor image [x,y]
        # CURSOR_SPEED: Self-explanatory
        # CURSOR_MARGIN: Margin of the cursor so that it wouldn't reach the edge of
        #                the screen.
        #---------------------------------------------------------------------------
        CURSOR_IMAGE = 'WM_Cursor'
        CURSOR_ORIGIN = [0,23]
        CURSOR_SPEED = 5
        CURSOR_MARGIN = 0
        #---------------------------------------------------------------------------
        # LOCDISP_ENABLED: Show the name of the location when hovering into one?
        # LOCDISP_OFFSET: Offset of the location name when displayed [x,y]
        #---------------------------------------------------------------------------
        LOCDISP_ENABLED = true
        LOCDISP_OFFSET = [0,12]
        #---------------------------------------------------------------------------
        # GOTOLOC_TEXT: Text that will be shown when confirming entry to location.
        # GOTOLOC_YES: "Yes" command text
        # GOTOLOC_NO: "No" command text
        #---------------------------------------------------------------------------
        GOTOLOC_TEXT = '%s'
        GOTOLOC_YES = 'Go'
        GOTOLOC_NO = 'Cancel'
        #---------------------------------------------------------------------------
        # FT_ENABLED: Allow Fast Travel menu?
        # FT_LABEL: Fast Travel label text shown above the menu
        # FT_LABEL_ALIGNMENT: The alignment of the FT label
        # FT_OPTIONS_ALIGNMENT: The alignment of the FT options
        #---------------------------------------------------------------------------
        FT_ENABLED = true
        FT_LABEL = 'Fast Travel'
        FT_LABEL_ALIGNMENT = 0
        FT_OPTIONS_ALIGNMENT = 1
        #---------------------------------------------------------------------------
        # MAP_DEFAULT_X: Default X coordinate of a map when from an unknown location
        # MAP_DEFAULT_Y: Same as above but for Y coordinate
        # MAP_SCROLL_SPEED: The scroll speed of the map when the cursor reaches
        #                   the margin.
        #---------------------------------------------------------------------------
        MAP_DEFAULT_X = Graphics.width / 2
        MAP_DEFAULT_Y = Graphics.height / 2
        MAP_SCROLL_SPEED = 5
        #---------------------------------------------------------------------------
        # Here is where Map Points (locations) are configured.
        # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        # :name => self-explanatory
        # :map_x => X coord of the location on the map
        # :map_y => Y coord of the location on the map
        # :map_icon_index => Index of the icon that will be shown in the map
        # :transfer_mapid => Map ID of where the player will be transfered to
        # :transfer_x => X coordinate of where the player will be transfered to
        # :transfer_y => Same as above but for Y coordinate
        # :transfer_f => Where the player will face when transfered
        #                (NumPad style, 2 for down, 4 for left, etc.)
        # :default => Is the location unlocked at the beginning?
        #---------------------------------------------------------------------------
        MAPS = [
            # Map 0
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
            # Map 1
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
            # Map 2
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
        ]
    
        MAPS[0][:map_points].push({:name=>'Name',
            :map_x => 439,
            :map_y => 224,
            :map_icon_index => 1508,
            :transfer_mapid => 1,
            :transfer_x => 8,
            :transfer_y => 6,
            :transfer_f => 2,
            :default => false});
    #===============================================================================
    # [CONFIG END]
    #-------------------------------------------------------------------------------
    # [WARNING]
    # Do NOT, and I repeat, do NOT edit anything below this part unless you know
    # what you're doing. I won't be responsible if your computer blows up just
    # because you tinkered with some code and made impossibly fatal errors.
    #===============================================================================
      end
    end
    
    module Sound
      def self.play_bgm_worldmap
        props = DAI::WORLDMAP::MAPS[$current_world_map][:bgm_properties]
        Audio.bgm_play('Audio/BGM/' + props[0],props[1],props[2])
      end
    end
    
    class Game_Temp
      
      attr_reader :iwm_location
      
      alias_method :dni_iwm_init, :initialize
      
      def initialize
        dni_iwm_init
        @iwm_location = ''
      end
      
      def set_iwm_location(locname)
        @iwm_location = locname
      end
      
      def get_iwm_location
        @iwm_location
      end
      
    end
    
    class Game_Party
      
      attr_accessor :locations
      
      alias_method :dni_iwm_init, :initialize
      def initialize
        dni_iwm_init
        @locations = Hash.new
        for loc in DAI::WORLDMAP::MAPS[$current_world_map][:map_points]
          @locations[loc[:name]] = true if loc[:default] == true
        end
      end
      
    end
    
    class Game_Interpreter
      
      def fadeout_all(time = 1000)
        #RPG::BGM.fade(time)
        RPG::BGS.fade(time)
        RPG::ME.fade(time)
        Graphics.fadeout(time * Graphics.frame_rate / 1000)
        RPG::BGM.stop
        RPG::BGS.stop
        RPG::ME.stop
      end
      
      def call_worldmap(locname='')
        $game_temp.set_iwm_location(locname)
        fadeout_all
        SceneManager.call(Scene_WorldMap)
      end
      
      def unlock_location(locname,enabled=true)
        for loc in DAI::WORLDMAP::MAPS[$current_world_map][:map_points]
          if loc[:name] == locname
            $game_party.locations[locname] = enabled
            return
          end
        end
      end
      
      def enable_location(locname)
        if $game_party.locations.keys.include?(locname)
          $game_party.locations[locname] = true
          
        end
      end
      
      def disable_location(locname)
        if $game_party.locations.keys.include?(locname)
          $game_party.locations[locname] = false
        end
      end
      
      def location_unlocked?(locname)
        $game_party.locations.keys.include?(locname)
      end
      
      def location_enabled?(locname)
        if $game_party.locations.keys.include?(locname)
          $game_party.locations[locname]
        end
        false
      end
      
    end
    
    class Window_WorldMapFTLabel < Window_Base
      def initialize
        x = Graphics.width - 250
        y = 0
        width = 250
        height = fitting_height(1)
        super(x,y,width,height)
        self.openness = 0
        refresh
      end
      
      def alignment
        DAI::WORLDMAP::FT_LABEL_ALIGNMENT
      end
      
      def refresh
        contents.clear
        draw_text(0,0,contents.width,line_height,DAI::WORLDMAP::FT_LABEL,alignment)
      end
      
    end
    
    class Window_WorldMapFTCmd < Window_Command
      
      def initialize(x,y)
        super
        deactivate
        self.openness = 0
      end
      
      def window_width
        250
      end
      
      def alignment
        DAI::WORLDMAP::FT_OPTIONS_ALIGNMENT
      end
      
      def window_height
        Graphics.height - fitting_height(1)
      end
      
      def make_command_list
        for location in $game_party.locations.keys.sort
          add_command(location,nil)
        end
      end
      
    end
    
    
    class Window_WorldMapConfirmCmd < Window_HorzCommand
      
      def initialize
        x = (Graphics.width - window_width)/2
        y = (Graphics.height - window_height)/2 + fitting_height(1)/2
        super(x,y)
        deactivate
        self.openness = 0
      end
      
      def window_width
         return Graphics.width * 2 / 3
      end
      
      def col_max
        return 2
      end
      
      def make_command_list
        add_command(DAI::WORLDMAP::GOTOLOC_YES,:enter)
        add_command(DAI::WORLDMAP::GOTOLOC_NO,:exit)
      end
      
    end
    
    class Window_WorldMapConfirmMsg < Window_Base
      
      def initialize
        width = Graphics.width * 2 / 3
        height = fitting_height(1)
        x = (Graphics.width - width) / 2
        y = (Graphics.height - height) / 2 - fitting_height(1)/2
        super(x,y,width,height)
        self.openness = 0
      end
      
      def open(locname='')
        super()
        @locname = locname
        refresh
      end
      
      def refresh
        contents.clear
        text = sprintf(DAI::WORLDMAP::GOTOLOC_TEXT,@locname)
        draw_text(0,0,contents.width,line_height,text,1)
      end
      
    end
    
    class Scene_WorldMap < Scene_Base
        
      def draw_icon(icon_index, x, y, enabled=true)
        sprite = Sprite.new
        sprite.bitmap = Bitmap.new(24,24)
        bitmap = Cache.system("Iconset")
        rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
        sprite.bitmap.blt(0, 0, bitmap, rect, enabled ? 255 : 160)
        sprite.ox = 11
        sprite.oy = 11
        sprite.x = x
        sprite.y = y
        sprite.viewport = @map_viewport
        return sprite
      end
      
      def start
        super
        Sound.play_bgm_worldmap if DAI::WORLDMAP::MAPS[$current_world_map][:bgm_enabled]
        @mode = 'map'
        make_map
        make_locations
        make_locdisp
        make_cursor
        make_confirm_windows
        make_ft_windows
        loc = get_location_item($game_temp.get_iwm_location)
        cursor_to_location(loc) if loc != nil
      end
      
      def update
        super
        bool1 = Input.dir8 != 0 && @mode == 'map'
        bool2 = get_cursor_hor_edge != 0 || get_cursor_ver_edge != 0
        update_input
        update_map if bool2
        update_cursor if bool1
        update_locdisp if bool1 || bool2
      end
      
      def terminate
        super
        @locdisp.dispose
      end
      
      def get_location_item(locname)
        for location in DAI::WORLDMAP::MAPS[$current_world_map][:map_points]
          return location if location[:name] == locname
        end
        return nil
      end
      
      def cursor_to_location(loc)
        new_ox = loc[:map_x] - Graphics.width / 2
        new_oy = loc[:map_y] - Graphics.height / 2
        @map_viewport.ox = [[0,new_ox].max,@map.width - Graphics.width].min
        @map_viewport.oy = [[0,new_oy].max,@map.height - Graphics.height].min
        @cursor.x = loc[:map_x] - @map_viewport.ox
        @cursor.y = loc[:map_y] - @map_viewport.oy
        update_locdisp
      end
      
      def update_map_ft
        loc = get_location_item(@window_ftcmd.current_data[:name])
        cursor_to_location(loc)
      end
        
      alias_method :dni_iwm_return_scene, :return_scene
      def return_scene
        fadeout_all
        dni_iwm_return_scene
        $game_map.autoplay
      end
      
      def update_input
        if @mode == 'map'
          return_scene if Input.trigger?(:B)
          confirm_location if Input.trigger?(:C)
          ft_mode if Input.trigger?(:A) && DAI::WORLDMAP::FT_ENABLED
          #RPG::SE.new("INT_Ope", 100, 100).play
        elsif @mode == 'ft' && (Input.trigger?(:DOWN) || Input.trigger?(:UP))
          update_map_ft
        end
      end
      
      def ft_mode
        @mode = 'ft'
        @window_ftlab.open
        @window_ftcmd.open
        @window_ftcmd.activate
        update_map_ft
      end
      
      def confirm_location
        if @locname != ''
          if $game_party.locations[@locname] == true
            Sound.play_ok
            @mode = 'confirm'
            @window_confmsg.open(@locname)
            @window_confcmd.open
            @window_confcmd.activate
          else
            Sound.play_buzzer
          end
        end
      end
      
      def update_locdisp
        @locdisp.bitmap.clear
        for location in @map_locations.keys
          orig_x = @map_locations[location].x - @map_viewport.ox
          orig_y = @map_locations[location].y - @map_viewport.oy
          bool1 = (@cursor.x - orig_x).abs <= 12
          bool2 = (@cursor.y - orig_y).abs <= 12
          if bool1 && bool2
            @locname = location
            @locdisp.bitmap.draw_text(0,0,@locdisp.width,24,location,1)
            @locdisp.x = @cursor.x + DAI::WORLDMAP::LOCDISP_OFFSET[0]
            @locdisp.y = @cursor.y + DAI::WORLDMAP::LOCDISP_OFFSET[1]
            return
          end
        end
        @locname = ''
      end
      
      def on_confirmcmd_ok
        loc = get_location_item(@locname)
        $game_player.reserve_transfer(loc[:transfer_mapid], loc[:transfer_x],
        loc[:transfer_y], loc[:transfer_f])
        $game_player.perform_transfer
        return_scene
      end
      
      def on_confirmcmd_cancel
        @window_confmsg.close
        @window_confcmd.close
        @window_confcmd.deactivate
        @mode = 'map'
      end
      
      def on_ftcmd_exit
        @window_ftlab.close
        @window_ftcmd.close
        @window_ftcmd.deactivate
        @mode = 'map'
      end
      
      def update_cursor
        if Input.dir8 != 0
          case Input.dir8
          when 1,4,7
            @cursor.x -= DAI::WORLDMAP::CURSOR_SPEED
          when 3,6,9
            @cursor.x += DAI::WORLDMAP::CURSOR_SPEED
          end
          case Input.dir8
          when 7,8,9
            @cursor.y -= DAI::WORLDMAP::CURSOR_SPEED
          when 1,2,3
            @cursor.y += DAI::WORLDMAP::CURSOR_SPEED
          end
        end
        margin = DAI::WORLDMAP::CURSOR_MARGIN
        @cursor.x = [[margin,@cursor.x].max,Graphics.width - margin].min
        @cursor.y = [[margin,@cursor.y].max,Graphics.height - margin].min
      end
      
      def update_map
        scroll_spd = DAI::WORLDMAP::MAP_SCROLL_SPEED
        case get_cursor_hor_edge
        when -1
          @map_viewport.ox -= scroll_spd
        when 1
          @map_viewport.ox += scroll_spd
        end
        @map_viewport.ox = [[0,@map_viewport.ox].max,@map.width - Graphics.width].min
        case get_cursor_ver_edge
        when -1
          @map_viewport.oy -= scroll_spd
        when 1
          @map_viewport.oy += scroll_spd
        end
        @map_viewport.oy = [[0,@map_viewport.oy].max,@map.height - Graphics.height].min
      end
      
      def get_cursor_hor_edge
        margin = DAI::WORLDMAP::CURSOR_MARGIN
        return -1 if @cursor.x == margin
        return 1 if @cursor.x == Graphics.width - margin
        return 0
      end
      
      def get_cursor_ver_edge
        margin = DAI::WORLDMAP::CURSOR_MARGIN
        return -1 if @cursor.y == margin
        return 1 if @cursor.y == Graphics.height - margin
        return 0
      end
      
      def make_ft_windows
        @window_ftlab = Window_WorldMapFTLabel.new
        x = Graphics.width - 250
        y = @window_ftlab.height
        @window_ftcmd = Window_WorldMapFTCmd.new(x,y)
        @window_ftcmd.set_handler(:ok, method(:on_ftcmd_exit))
        @window_ftcmd.set_handler(:cancel, method(:on_ftcmd_exit))
      end
      
      def make_confirm_windows
        @window_confmsg = Window_WorldMapConfirmMsg.new
        @window_confcmd = Window_WorldMapConfirmCmd.new
        @window_confcmd.set_handler(:enter, method(:on_confirmcmd_ok))
        @window_confcmd.set_handler(:cancel, method(:on_confirmcmd_cancel))
        @window_confcmd.set_handler(:exit, method(:on_confirmcmd_cancel))
      end
      
      def make_locdisp
        @locname = ''
        @locdisp = Sprite.new
        @locdisp.bitmap = Bitmap.new(Graphics.width,24)
        @locdisp.ox = Graphics.width / 2
        @locdisp.oy = 11
        @locdisp.viewport = @interface_viewport
      end
      
      def make_map
        @map = Sprite.new
        @map.bitmap = Cache.picture(DAI::WORLDMAP::MAPS[$current_world_map][:map_image])
        @map_viewport = Viewport.new(@map.src_rect)
        @map.viewport = @map_viewport
        @map.z = -2
      end
      
      def make_locations
        @map_locations = Hash.new
        for locname in $game_party.locations.keys
          enabled = $game_party.locations[locname]
          location = get_location_item(locname)
          index = location[:map_icon_index]
          sprite = draw_icon(index,location[:map_x],location[:map_y],enabled)
          @map_locations[location[:name]] = sprite
        end
      end
      
      def make_cursor
        @cursor = Sprite.new
        @cursor.bitmap = Cache.picture(DAI::WORLDMAP::CURSOR_IMAGE)
        @cursor.blend_type = 0
        @cursor.ox = DAI::WORLDMAP::CURSOR_ORIGIN[0]
        @cursor.oy = DAI::WORLDMAP::CURSOR_ORIGIN[1]
        @cursor.x = Graphics.width / 2
        @cursor.y = Graphics.height / 2
        @cursor.z = 0
        @interface_viewport = Viewport.new(0,0,Graphics.width, Graphics.height)
        @cursor.viewport = @interface_viewport
      end
      
    end

     

    Non ho scritto commenti ma per creare le mappe devi agire qui:

    MAPS = [
            # Map 0
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
            # Map 1
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
            # Map 2
            {:map_points => [], :map_image => 'Picture', :bgm_properties => ['Theme1',70,100], :bgm_enable => true},
        ]
    
        MAPS[0][:map_points].push({:name=>'Name',
            :map_x => 439,
            :map_y => 224,
            :map_icon_index => 1508,
            :transfer_mapid => 1,
            :transfer_x => 8,
            :transfer_y => 6,
            :transfer_f => 2,
            :default => false});

    Nel blocco chiamato MAPS, inserisci le informazioni relative alla tue mappa, come ad esempio l'immagine della mappa o la musica di sottofondo. Lascia vuoto map_points. Se vuoi aggiungere nuovi punti alla mappa, basta copiare e modificare la seconda riga di codice, cambiando i dettagli in base a quello che ti serve. Ricorda che il numero che vedi davanti a ogni mappa (ad esempio MAPS[0], MAPS[1], ecc.) indica quale mappa stai modificando.

    Per scegliere quale mappa visualizzare crea uno script in un evento e scrivi:

    $current_world_map = INDICE_DELLA_MAPPA

    Ad esempio $current_world_map = 0 se vuoi impostare la mappa 0.

  4. Ad occhio c'è un problema con questo script.

    Se metti l'attributo di mostrato o no nella skill, significa che se due personaggi hanno skill uguali non posso scegliere di mostrarla su uno e nasconderla sull'altro.

    Dovresti gestire un array di skill nascoste sulla classe Game_Actor, e quindi aggiungere o rimuovere l'ID della skill quando il giocatore vuole nasconderla o mostrarla.

    Altra cosa, è inutile che crei gli alias se poi effettivamente sovrascrivi l'intero metodo.

    Grazie mille per il feedback holy, ho testato e hai perfettamente ragione. Credevo che ogni attore avesse una propria istanza della skill... e invece no °-°

    Alla fine ho rubato il tuo consiglio sul vettore e ho aggiornato il codice fixando il bug, rimuovendo gli alias inutili e snellendo un po' il codice.

     

    Dovresti gestire il colore del nome della skill se è disabilitato, altrimenti chiami il metodo aliasato senza doverlo riscrivere. Così come hai fatto impasticcerai la compatibilità con altri script.

    Perdonami ma non ho capito cosa intendi in questo punto (sono un po' un neofita in ruby perdonami ahahahaha), a prescindere però da questo ho provato a riscrivere quelle funzioni lì cercando di dare un senso all'alias.

  5. Abilità equipaggiate

    Descrizione

    Lo script limita il numero di skill mostrate in battaglia per un certo actor, può essere utile per:

    • Limitare il giocare a un moveset ristretto (come in pokémon)
    • Evitare situazioni spiacevoli in cui il player nelle parti finali del gioco si trovi una schermata piena di skill inutili.
    • Creare un sistema per cui un attore, aumentando di livello, possa aumentare il numero di slot per le abilità disponibili (non supportato al 100% ma facilmente implementabile)

    Insomma, come in molti casi, il limite è la fantasia! Per abilitare o disabilitare una skill, basta andare nell'apposita sezione del menù della mappa, posizionare il cursore sull'abilità che si vuole attivare/disabilitare e premere shift.

    Nota bene: Ho iniziato a fare script da poco, quindi il codice potrebbe essere un po' sporco perché non mi è ancora chiaro come Vx Ace gestisce le diverse classi. Scripter più esperti fatemi sapere cosa potrei fare meglio :bigsmile:

     

    Autore

    Raffy2010.

     

    Istruzioni per l'uso

    Copiare lo script sotto Materials e prima del Main.

     

    Script

     

    module Skill_Equip
    #===============================================================================
    # Abilità equipaggiate versione 1.01
    #===============================================================================
    # Autore: Raffy2010
    # Difficoltà utente: Basta che tu sappia copiare e incollare
    #
    #-------------------------------------------------------------------------------
    # Descrizione:
    # Lo script limita il numero di skill mostrate in battaglia per un certo actor,
    # può essere utile per:
    # - Limitare il giocare a un moveset ristresso (come in pokémon)
    # - Evitare situazioni spiacevoli in cui il player nelle parti finali
    # del gioco si trovi una schermata piena di skill inutili.
    # - Creare un sistema per cui un attore, aumentando di livello, possa
    # aumentare il numero di slot per le abilità disponibili (non supportato
    # al 100% ma facilmente implementabile)
    # Insomma, come in molti casi, il limite è la fantasia!
    # Per abilitare o disabilitare una skill, basta andare nell'apposita sezione
    # del menù della mappa, posizionare il cursore sull'abilità che si vuole
    # attivare/disabilitare e premere shift.
    #-------------------------------------------------------------------------------
    # Istruzioni:
    # Copiare lo script sotto Materials e prima del Main.
    #-------------------------------------------------------------------------------
    # Compatibilità:
    # Window_SkillList
    # > alias draw_item_name
    # > alias draw_skill_cost
    # Window_BattleSkill
    # > alias make_item_list
    # Window_Selectable
    # > alias process_handling
    # Scene_Skill
    # > alias create_item_window
    # Game_Actor
    # > alias setup
    #-------------------------------------------------------------------------------
    # Configurazione:
    # Numero di slot disponibili di default:
    SLOTS = 4
    # Colore da assegnare alle skill disabilitate (R,G,B, TRASPARENZA):
    DISABLED_SKILL_COLOR = Color.new(128,0,0,256)
    #-------------------------------------------------------------------------------
    # Per gli scripter
    # Sono state aggiunti due attributi alla classe Game_Actor:
    # - attr_accessor :enabled_skills_list -> Vettore delle skill abilitate
    # - attr_reader :maximum_number_of_slots -> Numero massimo di slot disponibili
    #
    # Magari possono esservi utili per fare qualcosa ;)
    #-------------------------------------------------------------------------------
    # FINE CONFIGURAZIONE
    #-------------------------------------------------------------------------------
    end

    class Window_SkillList < Window_Selectable
    include Skill_Equip
    #--------------------------------------------------------------------------
    # * Draw Item Name
    # Riscrivo il metodo per stampare il nome di un certo colore quando la
    # skill è disabilitata.
    #--------------------------------------------------------------------------
    alias :skill_Equip_window_SkillList_draw_item_name :draw_item_name
    def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    if @actor.enabled_skills_list.include?(item)
    skill_Equip_window_SkillList_draw_item_name(item, x, y, enabled, width)
    else
    draw_icon(item.icon_index, x, y, enabled)
    change_color(DISABLED_SKILL_COLOR, enabled)
    draw_text(x + 24, y, width, line_height, item.name)
    end
    end
    #--------------------------------------------------------------------------
    # * Draw Skill Use Cost
    # Riscrivo il metodo per stampare il costo.
    #--------------------------------------------------------------------------
    alias :skill_Equip_window_SkillList_draw_skill_cost :draw_skill_cost
    def draw_skill_cost(rect, skill)
    if @actor.enabled_skills_list.include?(skill)
    skill_Equip_window_SkillList_draw_skill_cost(rect, skill)
    else
    change_color(DISABLED_SKILL_COLOR, enable?(skill))
    if @actor.skill_mp_cost(skill) > 0
    draw_text(rect, @actor.skill_mp_cost(skill), 2)
    elsif @actor.skill_tp_cost(skill) > 0
    draw_text(rect, @actor.skill_tp_cost(skill), 2)
    end
    end
    end
    end
    #--------------------------------------------------------------------------
    # * Riscrivo il make_item_list di BattleSkill per stampare esclusivamente
    # le skill abilitate in BATTAGLIA.
    #--------------------------------------------------------------------------
    class Window_BattleSkill < Window_SkillList
    alias :skill_Equip_Window_BattleSkill_make_item_list :make_item_list
    def make_item_list
    skill_Equip_Window_BattleSkill_make_item_list
    @data.delete_if{|skill| not @actor.enabled_skills_list.include?(skill)}
    end
    end
    #--------------------------------------------------------------------------
    # * Gestione del tasto shift
    #--------------------------------------------------------------------------
    class Window_Selectable < Window_Base
    #--------------------------------------------------------------------------
    # * Aggiungo l'handler per lo shift
    #--------------------------------------------------------------------------
    alias :skill_Equip_Windows_Selectable_process_handling :process_handling
    def process_handling
    return unless open? && active
    skill_Equip_Windows_Selectable_process_handling
    return call_handler(:shift) if handle?(:shift) && Input.trigger?(:A)
    end
    end

    class Scene_Skill < Scene_ItemBase
    #--------------------------------------------------------------------------
    # * Create Item Window
    #--------------------------------------------------------------------------
    alias :skill_Equip_Scene_Skill_create_item_window :create_item_window
    def create_item_window
    skill_Equip_Scene_Skill_create_item_window
    @item_window.set_handler(:shift, method(:on_item_shift))
    end
    #--------------------------------------------------------------------------
    # * on_item_shift
    #--------------------------------------------------------------------------
    def on_item_shift
    if @actor.enabled_skills_list.include?(item)
    @actor.enabled_skills_list.delete(item)
    elsif @actor.enabled_skills_list.size + 1 > @actor.maximum_number_of_slots
    Sound.play_buzzer
    return
    else
    @actor.enabled_skills_list.push(item)
    end
    Sound.play_equip
    @item_window.refresh
    @status_window.refresh
    end
    end
    #--------------------------------------------------------------------------
    # * Aggiungo due attributi per gestire la lista delle skill
    #--------------------------------------------------------------------------
    class Game_Actor < Game_Battler
    include Skill_Equip
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_accessor :enabled_skills_list
    attr_reader :maximum_number_of_slots
    #--------------------------------------------------------------------------
    # * Setup
    #--------------------------------------------------------------------------
    alias :skill_Equip_Game_Actor_setup :setup
    def setup(actor_id)
    skill_Equip_Game_Actor_setup(actor_id)
    @enabled_skills_list = Array.new
    @maximum_number_of_slots = SLOTS
    end
    end

     

    Bugs e Conflitti Noti

    N/A

     

    EDIT: Codice aggiornato

  6. Senza aprire un nuovo topic mi dite perché questo evento comune non va?

     

    Processo parallelo Quando switch Y è on

     

    Condizione:se switch X è on

    -Condizione:se tasto A è premuto

    -Cambia grafica eroe

     

    Condizione:se switch X è off

    -Condizione:se tasto A è premuto

    -Cambia grafica eroe

  7. Se Falcao ti piace come sistema basta impostarlo in questo modo in modo da non mostrarlo nel menù che si apre con esc.

     

    #==============================================================================#
    # #*****************# #
    # #*** By Falcao ***# * Falcao Mmorpg Alchemy and Extraction System #
    # #*****************# This script allows the player to learn two new #
    # skills, Alchemy and extraction, both of them #
    # RMVXACE used to create Items. Date: March 25 2013 #
    # #
    # Falcao RGSS site: http://falcaorgss.wordpress.com #
    # Falcao Forum site: http://makerpalace.com #
    #==============================================================================#

    #-------------------------------------------------------------------------------
    # What is this?
    #
    # - Alchemy is a system that allows you create Items, Weapons and armors by
    # combining a list of ingredients.
    # - Extraction is a system that allows you extract ingredients from things like
    # plants, rocks etc.
    #
    # It is called Crafting
    #-------------------------------------------------------------------------------

    #-------------------------------------------------------------------------------
    # * Features
    #
    # - Full Alchemy skill system
    # - Full Extraction skill system
    # - Alchemy and extraction Leveling system
    # - Full alchemy and extraction variance system
    # - Alchemy can create Weapons, Armors and Items
    # - In game maximun Alchemy and extraction levels enabled
    # - Alchemy Support up to 20 ingredients mix
    # - Alchemy and Extraction, speed, quantity, chance enabled
    # - Recipes levels enabled
    # - Extraction plants levels enabled
    # - Extractions plants respawn enabled
    # - Recipes system
    # - Flexible and easy recipe creation
    # - Easy to use
    #-------------------------------------------------------------------------------

    # * Terms and license

    # - Do credit me Falcao as the creator of this system
    # - You can modify anything you want
    # - You are allowed to distribute this material in any webpage
    # - Do not remove the header of any script shelf
    # - You are free to use this script in non-comercial projects, for comercial
    # projects contact me falmc99@gmail.com

    =begin
    ===============================================================================
    * Script Manual

    *************************
    * Alchemy skill set up *

    Use the following script call to display the alchemy GUI
    SceneManager.call(Scene_Alchemy)

    You will see an empty GUI, the first thing you have to do is create a recipe
    in the database item section using the following notetags

    - Here a normal recipe set up












    - Tags explanation


    recipe output item type, it can be Item, Weapon or Armor


    Item Type id you choose


    Chance to produce the item, it can be a number form 1 to 100 percent of chance


    How many items you want to get when succes producing?


    production speed, it display a hud. it support decimals


    Level of the recipe (if the player alchemy level is below he cant learn it)


    Ingredients items ids required to produce the output item


    Quantity of item Mixs required to produce the Ouput item, MUST be in the same
    order of Item Mixs. In this case item id 17 require 3 or more, item id 18
    require 2 and item id 19 require 2.

    * IMPORTANT
    Once the game party gets the Item recipe, the game player has to learn the
    recipe from the inventory menu in order to be displayed in the alchemy GUI

    -------------------------------------
    * Extraction skill set up *

    In order to extract items plants, rocks or whatever you need, create an event
    with the following comment tags.

    Here a regular plant creation









    Tags explanation


    Which item id do you want to extract?


    How many items will be extracted?


    Extraction success chance, it can be a number between 1 to 100 percent


    Extraction speed, it support decimals


    item extraction level, if player extraction skill is below this level it cannot
    be extracted


    How many times you want this plant to be extracted before dissapear?


    Time in seconds this plant takes to respawn

    IMPORTANT NOTE!
    I strongly recomend to see this script demo examples for the correct usage of
    this complex system

    =end

    #===============================================================================
    # * Alchemy skill settings
    #===============================================================================
    module FalcaoAlchemy

    # After how many production times get a chance to level up
    ProductionTimesLevelUp = 3

    # Chance to level up when the production times match
    AlchemyLevelUpChance = 70

    # After how many party alchemy skill level above of Recipe level have a chance
    # to level up the alchemy skill. Example: Alchemy level = 20
    # Recipe level = 9, there are 11 levels above so party can not level up skill
    SeparateLevel = 10

    # Default alchemy maximun level (can be changed in game)
    DefaultMaxLevel = 30

    # Sound played when succes produce an item
    SuccesProduceSe = "Decision2"

    # Sound played when fail producing an item
    FailProduceSe = "Stare"

    # Sound played when succes level up the alchemy skill
    AlchemyLevelUpSe = "Raise1"
    end


    #===============================================================================
    # * Extraction skill settings
    #===============================================================================
    module FalExtract

    # After how many extraction times get a chance to level up
    ExtracTimesLevelUp = 4

    # Chance to level up when the production times match
    ExtracLevelUpChance = 80

    # After how many party extraction skill level above of Plant level have a
    # chance to level up the extraction skill. Example: Extraction level = 20
    # Plant level = 9, there are 11 levels above so party can not level up skill
    SeparateLevell = 5

    # Default extraction maximun level (can be changed in game)
    DefaultMaxLevel = 40

    # Animation id played while extracting
    ExAnimation = 111

    # Sound played when succes extrac an item
    SuccesExtractSe = "Item3"

    # Sound played when fail extract an item
    FailExtractSe = "Down1"

    # Sound played when level up extraction skill
    AlchemyLevelUpSe = "Raise1"

    #-----------------------------------------------
    def self.check_extracted_ones
    $game_map.events.values.each do |event|
    break if $game_party.ev_extdata[$game_map.map_id].nil?
    if !$game_party.ev_extdata[$game_map.map_id][event.id].nil?
    event.erase if $game_party.ev_extdata[$game_map.map_id][event.id][2]
    end
    end
    end
    end

    #Do you want to add the alchemy scene to the game menu? true / false
    FalcaoRGSS_AddAlchemy_to_menu = false

    #-----------------------------------------------------------------------------
    # * Script calls
    #
    # Use this script call only if you want to change the extraction and alchemy
    # levels manually
    #
    # $game_party.alchemy_maxlv(x) If you want to change the alchemy maximun level
    # in game change x for the new maximun level
    # $game_party.alchemy_lv = x if you want to change the current alchemy level
    # change x for the new level

    # $game_party.extraction_maxlv(x) Extraction max level, change x for the new
    # maximun level
    # $game_party.extract_lv = x Extraction current level, change x for any
    # integer
    #-------------------------------------------------------------------------------

    ($imported ||= {})['Falcao Mmorpg Alchemy And Extraction'] = 1.0

    #===============================================================================
    # * Falcao Alchemy skill END OF SETINGS
    #===============================================================================
    class RecipeData
    attr_accessor :recipes
    def initialize
    @recipes = {}
    @ingredients = {}
    register_values
    end

    def register_values
    for item in $data_items
    next if item.nil?
    id = item.recipedata(" @ingredients[item.id] = mix.split(",").map { |s| s.to_i }
    end
    end

    def recipes
    @recipes
    end

    def ingredients
    @ingredients
    end
    end

    class RPG::BaseItem
    def recipedata(comment, s=true, f=false)
    if @note =~ /#{comment}(.*)>/i
    return $1.to_f if f
    return s ? $1.to_i : $1.to_s.sub("\r","")
    end
    end

    def costitem
    if @costitemm.nil?
    @costitemm = {}
    if @note =~ //i
    key = $1.to_s.sub("\r","").split(",").map { |s| s.to_i }
    end
    if @note =~ //i
    value = $1.to_s.sub("\r","").split(",").map { |s| s.to_i }
    end
    if key != nil
    index = 0
    key.each {|k|
    @costitemm[k] = value[index]
    index += 1}
    end
    return @costitemm
    else
    return @costitemm
    end
    end
    end

    class Game_Party < Game_Unit
    attr_reader :recipes
    attr_accessor :extract_data, :extract_lv, :extrat_count, :ev_extdata
    attr_accessor :alchemy_lv, :alchemy_count, :pop_windowdata
    attr_accessor :al_maxlv, :ex_maxlv
    alias falcaoalchemy_ini initialize
    def initialize
    @recipes = []
    @extract_lv = 1
    @extrat_count = 0
    @ev_extdata = {}
    @alchemy_lv = 1
    @alchemy_count = 0
    @al_maxlv = FalcaoAlchemy::DefaultMaxLevel
    @ex_maxlv = FalExtract::DefaultMaxLevel
    falcaoalchemy_ini
    end

    def alchemy_maxlv(lv)
    @al_maxlv = lv if lv >= @al_maxlv
    end

    def extraction_maxlv(lv)
    @ex_maxlv = lv if lv >= @ex_maxlv
    end

    def add_recipe(id)
    @recipes.push(id) unless @recipes.include?(id)
    end

    def pop_w(time, name, text)
    return unless @pop_windowdata.nil?
    @pop_windowdata = [time, text, name]
    end
    end

    class Game_Battler < Game_BattlerBase
    alias falcaoalchemy_mm_item consume_item
    def consume_item(item)
    if item.is_a?(RPG::Item) and !item.recipedata(" $game_party.add_recipe(item.id)
    $game_party.pop_w(
    180, 'Alchemy', "Recipe: #{item.name} has been learned!")
    else
    $game_party.gain_item(item, 1)
    $game_party.pop_w(
    180,'Alchemy',"Alchemy level #{level} is required to learn this recipe")
    Sound.play_buzzer
    end
    end
    falcaoalchemy_mm_item(item)
    end
    end

    #-------------------------------------------------------------------------------
    class Window_AlRecipes < Window_Selectable
    def initialize(x, y, w, h, rdata)
    super(x, y, w, h)
    @rdata = rdata
    refresh ; select(0)
    end

    def item() return @data[self.index] end

    def refresh
    self.contents.clear if self.contents != nil
    @data = []
    @rdata.recipes.each {|id, recipe| @data.push(recipe) if
    $game_party.recipes.include?(id)}
    @item_max = @data.size
    if @item_max > 0
    self.contents = Bitmap.new(width - 32, row_max * 26)
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end

    def draw_item(index)
    item = @data[index]
    x, y = index % col_max * (90), index / col_max * 24
    self.contents.font.size = 18
    draw_icon($data_items[item[7]].icon_index, x, y)
    contents.draw_text(x + 25, y, self.width, 32, item[0])
    end

    def item_max
    return @item_max.nil? ? 0 : @item_max
    end
    end

    class Window_StartProducing < Window_HorzCommand
    def initialize(dark)
    @darked = dark
    super(200, 0)
    end
    def window_width() return 344 end
    def window_height() return 60 end

    def col_max
    return 2
    end

    def make_command_list
    add_command("Start", :start, @darked.items_ready?)
    add_command("Stop", :stop)
    end

    def process_cancel
    @darked.meter > 0 ? return : super
    end
    end


    class FalcaoExtraction
    include FalExtract
    def initialize
    @col = [Color.new(180, 225, 245), Color.new(20, 160, 225), Color.new(0,0,0)]
    @running = false
    @anitimer = 0
    end

    def update
    update_extraction_trigger if Input.trigger?(:C)
    update_display_window if $game_party.extract_data != nil
    update_respawn
    end

    def update_respawn
    return if $game_party.ev_extdata[$game_map.map_id].nil?
    $game_map.events.values.each do |event|
    break if $game_party.ev_extdata[$game_map.map_id].nil?
    if !$game_party.ev_extdata[$game_map.map_id][event.id].nil?
    if $game_party.ev_extdata[$game_map.map_id][event.id][2]
    $game_party.ev_extdata[$game_map.map_id][event.id][1] -= 1 if
    $game_party.ev_extdata[$game_map.map_id][event.id][1] > 0
    if $game_party.ev_extdata[$game_map.map_id][event.id][1] == 0
    event.fading = [:fade_out, 60]
    $game_party.ev_extdata[$game_map.map_id].delete(event.id)
    if $game_party.ev_extdata[$game_map.map_id].empty?
    $game_party.ev_extdata.delete($game_map.map_id)
    end
    next
    end
    end
    end
    end
    end

    def update_display_window
    create_window
    if $game_party.extract_data[5] > 0
    $game_party.extract_data[5] -= 1
    if $game_party.extract_data[5] == 0
    $game_party.extract_data = nil
    dispose_window
    @running = false
    return
    end
    end

    return if $game_party.extract_data[5] > 0
    if @running
    if $game_party.extract_data[5] == 0
    refresh_contents
    $game_party.extract_data[4] += 1
    end
    if $game_party.extract_data[4] >= $game_party.extract_data[3] * 60
    $game_party.extract_data[5] = 60
    refresh_contents
    end
    end
    end

    def create_window
    return if !@ext_window.nil?
    @ext_window = Window_Base.new(544 / 2 - 200 / 2, 0, 200, 66)
    if $game_party.extract_lv >= $game_party.extract_data[6]
    @running = true
    end
    refresh_contents
    end

    def refresh_contents
    @ext_window.contents.clear
    @ext_window.contents.fill_rect(0, 10, 26, 38, Color.new(0, 0, 0, 60))
    item = $game_party.extract_data[0]
    @ext_window.draw_icon(item.icon_index, 1, 11)
    @ext_window.contents.font.size = 18
    @ext_window.contents.font.color = @ext_window.normal_color
    @ext_window.contents.font.shadow = true
    string = "L#{$game_party.extract_data[6]} " + item.name
    @ext_window.draw_text(-4, -6, @ext_window.width, 32, string, 1)
    @ext_window.contents.font.size = 15
    @ext_window.draw_text(0, 22, 26, 32, $game_party.extract_data[1].to_s, 1)
    @ext_window.contents.font.size = 18
    if @running
    if $game_party.extract_data[5] == 60
    r = rand(101)
    @ext_window.contents.font.color = Color.new(255, 120, 0, 255)
    if r <= $game_party.extract_data[2]
    $game_party.gain_item($game_party.extract_data[0],
    $game_party.extract_data[1])
    RPG::SE.new(SuccesExtractSe, 80,).play
    @ext_window.draw_text(-30, 20, @ext_window.width, 32, 'Win', 2)
    if $game_party.extrat_count == ExtracTimesLevelUp - 1
    r2 = rand(101)
    if r2 <= ExtracLevelUpChance
    leveling = true unless stop_growing?
    apply_extraction_growing
    end
    else
    $game_party.extrat_count += 1
    end
    @anitimer = 0
    else
    RPG::SE.new(FailExtractSe, 80,).play
    @ext_window.draw_text(-30, 20, @ext_window.width, 32, 'Fail', 2)
    end
    apply_variance
    @running = false
    end
    run_extractor if leveling.nil?
    else
    @ext_window.draw_text(0, 16, @ext_window.width, 32,
    "Ext lv #{$game_party.extract_data[6]} required", 1)
    Sound.play_buzzer
    s = "Extraction skill level #{$game_party.extract_data[6]} required"
    $game_party.pop_w(180, 'Alchemy', s)
    $game_party.extract_data[5] = 120
    end
    end

    def stop_growing?
    lv = $game_party.extract_data[6]
    return true if $game_party.extract_lv == $game_party.ex_maxlv
    return true unless $game_party.extract_lv <= lv + SeparateLevell - 1
    return false
    end

    # growing
    def apply_extraction_growing
    return if stop_growing?
    RPG::SE.new(AlchemyLevelUpSe, 80,).play
    $game_party.extract_lv += 1
    $game_party.extrat_count = 0
    @ext_window.draw_text(30, 20, @ext_window.width, 32,
    "Skill Lv #{$game_party.extract_lv}!")
    end

    def apply_variance
    $game_party.ev_extdata[$game_map.map_id] = {} if
    $game_party.ev_extdata[$game_map.map_id].nil?
    event = $game_party.extract_data[7]
    times = event.check_ext("lv, event]
    break
    end
    end
    end

    def dispose
    dispose_window
    end
    end

    class Spriteset_Map
    alias falcaoextraction_create_p create_pictures
    def create_pictures
    falcaoextraction_create_p
    @falextraction = FalcaoExtraction.new
    end

    alias falcaoextraction_update update
    def update
    falcaoextraction_update
    @falextraction.update
    end

    alias falcaoextraction_dispose dispose
    def dispose
    falcaoextraction_dispose
    @falextraction.dispose
    end
    end

    class Game_Event < Game_Character
    attr_accessor :opacity, :erased, :fading
    def check_ext(comment, f=true)
    return 0 if @list.nil? or @list.size <= 0
    for item in @list
    if item.code == 108 or item.code == 408
    return f ? $1.to_i : $1.to_f if item.parameters[0] =~ /#{comment}(.*)>/i
    end
    end
    return 0
    end

    alias falcaoexts_ini initialize
    def initialize(map_id, event)
    @fading = [:fade_in, time=0]
    falcaoexts_ini(map_id, event)
    end

    alias falcaoexts_up update
    def update
    if @fading[1] > 0
    @fading[1] -= 1
    if @fading[0] == :fade_in
    @opacity -= 4 if @opacity >= 0
    erase if @fading[1] == 0
    elsif @fading[0] == :fade_out
    if @erased
    @erased = false
    refresh ; @opacity = 0
    end
    @opacity += 4 if @opacity <= 255
    end
    end
    falcaoexts_up
    end
    end

    class Game_Player < Game_Character
    attr_accessor :pattern
    def in_front_ext?(target)
    return true if @direction == 2 and @x == target.x and (@y+1) == target.y
    return true if @direction == 4 and (@x-1) == target.x and @y == target.y
    return true if @direction == 6 and (@x+1) == target.x and @y == target.y
    return true if @direction == 8 and @x == target.x and (@y-1) == target.y
    return false
    end

    def update_anime_pattern
    return if !$game_party.extract_data.nil?
    super
    end

    alias falcaoextraction_mov movable?
    def movable?
    return false if $game_party.extract_data != nil
    falcaoextraction_mov
    end

    alias falcaoext_perform_transfer perform_transfer
    def perform_transfer
    falcaoext_perform_transfer
    FalExtract.check_extracted_ones if $game_map.map_id != @new_map_id
    end
    end

    class << DataManager
    alias falcaoalchemy_mmo_load load_normal_database
    def DataManager.load_normal_database
    falcaoalchemy_mmo_load
    for item in $data_items
    next if item.nil?
    if item.recipedata("<output item="" id:="" ")="" !="nil
    item.name = item.name + " L#{item.recipedata(" item.consumable = true
    item.scope = 0
    end
    end
    end

    alias falcaoalchemy_reloadmap reload_map_if_updated
    def DataManager.reload_map_if_updated
    falcaoalchemy_reloadmap
    FalExtract.check_extracted_ones if
    $game_system.version_id != $data_system.version_id
    end
    end

    # ingrediebnts
    class AlIngredients
    attr_accessor :meter
    def initialize(rdata)
    @ingredients = Window_Base.new(200, 60, 344, 266)
    @recipe = []
    @meter = 0
    @rdata = rdata
    end

    def refresh(recipe)
    @recipe = recipe
    @ingredients.contents.clear
    @ingredients.contents.font.size = 18 ; w = @ingredients.width
    @ingredients.contents.fill_rect(0, 24, w, 220, Color.new(0, 0, 0, 60))
    apply_color(1)
    @ingredients.draw_text(-16, -6, w, 32, 'Ingredients', 1)
    draw_ingredients
    end

    def draw_ingredients
    manager = y = 0
    for i in ingredients
    item = $data_items
    manager += 1
    (manager%2 == 0) ? x = 156 : y += 24
    x = 0 unless (manager%2 == 0)
    enable = $game_party.item_number(item) >= cost[item.id]
    enable ? apply_color(1) : apply_color(2)
    @ingredients.draw_icon(item.icon_index, x, y, enable)
    @ingredients.contents.font.size = 15
    number = $game_party.item_number(item)
    @ingredients.draw_text(x - 2, y + 6, 32, 32, number.to_s, 1)
    @ingredients.contents.font.size = 18
    @ingredients.draw_text(x + 24, y,212,32, item.name + " X#{cost[item.id]}")
    end
    end

    def items_ready?
    return false if @meter > 0
    combi = ingredients ; item = [] ; combi = [] if combi.nil?
    combi.each {|i|
    it =$data_items; item << i if $game_party.item_number(it) >= cost[it.id]}
    item.size == combi.size
    end

    def apply_color©
    @ingredients.contents.font.color = @ingredients.normal_color if c == 1
    @ingredients.contents.font.color = Color.new(255,255,255,128) if c == 2
    end

    def ingredients
    return @rdata.ingredients[@recipe.last]
    end

    def dispose
    @ingredients.dispose
    end


    def update_index(recipe_index)
    @recipe_index = recipe_index
    end

    def cost
    return $data_items[@recipe_index].costitem
    end
    end

    #----------
    class Scene_Alchemy < Scene_MenuBase
    include FalcaoAlchemy
    def start
    super
    recipedata = RecipeData.new
    @col = [Color.new(180, 225, 245), Color.new(20, 160, 225), Color.new(0,0,0)]
    @meter = 0
    @infow = Window_Base.new(0, 0, 200, 60)
    @alstatus = Window_Base.new(0, 326, 200, 90)
    refresh_alstatus
    @infow.contents.font.size = 20
    @infow.draw_text(-16, 0, @infow.width, 32, 'Recipes', 1)
    @recipes = Window_AlRecipes.new(0, 60, 200, 266, recipedata)
    @ngrewindow = AlIngredients.new(recipedata)
    update_rindex
    @oven = Window_Base.new(200, 326, 344, 90)
    @pop_timer = 0
    update_recipe
    @start_window = Window_StartProducing.new(@ngrewindow)
    update_cancel
    @start_window.set_handler(:start, method(:update_start))
    @start_window.set_handler(:stop, method(:update_stop))
    @start_window.set_handler(:cancel, method(:update_cancel))
    end

    def refresh_alstatus
    @alstatus.contents.clear
    @alstatus.contents.font.size = 18; w = @alstatus.width ; g = $game_party
    @alstatus.draw_icon(218, 0, 16) ; arr = [g.al_maxlv.to_s, g.ex_maxlv.to_s]
    @alstatus.draw_icon(482, 0, 40)
    @alstatus.draw_text(-16, -8, w, 32, 'Skill Levels', 1)
    @alstatus.draw_text(26, 16, w, 32,"Alchemy: #{g.alchemy_lv}/" + arr[0])
    @alstatus.draw_text(26, 40, w, 32,"Extraction: #{g.extract_lv}/" + arr[1])
    end

    def update_start
    @ngrewindow.meter = 1
    end

    def update_stop
    @ngrewindow.meter = 0
    @start_window.refresh
    @start_window.activate
    refresh_oven
    end

    def output_item
    item = @recipes.item
    kind = $data_items[item[2]] if item[1]=='Item' || item[1]=='item'
    kind = $data_weapons[item[2]] if item[1]=='Weapon' || item[1]=='weapon'
    kind = $data_armors[item[2]] if item[1]=='Armor' || item[1]=='armor'
    kind
    end

    def update_cancel
    @start_window.unselect
    @start_window.deactivate
    @recipes.activate
    end

    def refresh_ingredients
    @ngrewindow.refresh(@recipes.item)
    end

    def refresh_oven
    @oven.contents.clear
    @oven.contents.font.size = 18
    @oven.contents.fill_rect(0, 31, 31, 36, Color.new(0, 0, 0, 60))
    @oven.draw_text(-16, -6, @oven.width, 32, 'Oven', 1)
    if @pop_timer > 0
    @oven.contents.font.color = Color.new(255, 120, 0, 255)
    @oven.draw_text(0, -6, @oven.width, 32, @type)
    end
    @oven.contents.font.color = @oven.normal_color
    @oven.draw_icon(output_item.icon_index, 4, 34)
    @oven.contents.font.size = 15
    @oven.draw_text(0, 45, 33, 32, @recipes.item[4], 1)
    @oven.contents.font.size = 18
    @oven.draw_text(34, 23, 250, 32, output_item.name)
    @oven.draw_text(-26, 23, @oven.width, 32, 'Chance', 2)
    @oven.draw_text(-26, 40, @oven.width, 32, @recipes.item[3].to_s + '%', 2)
    x, y = 33, 52
    @oven.contents.fill_rect(x, y, 150, 12, @col[2])
    max = @recipes.item[5] * 60
    @oven.contents.fill_rect(x+1, y+1, 152 *@ngrewindow.meter / max, 5, @col[0])
    @oven.contents.fill_rect(x+1, y+6, 152 *@ngrewindow.meter / max, 5, @col[1])
    end

    def update_rindex
    @ngrewindow.update_index(@recipes.item[7]) unless @recipes.item.nil?
    end

    def update
    super
    update_rindex
    update_recipe
    SceneManager.return if Input.trigger?(:B) and @recipes.active
    update_selection if Input.trigger?(:C) and @recipes.active and
    !@recipes.item.nil?
    update_meter
    end

    def update_meter
    if @pop_timer > 0
    @pop_timer -= 1
    refresh_oven if @pop_timer == 0
    end

    if @ngrewindow.meter != 0
    @start_window.refresh if @ngrewindow.meter == 1
    @start_window.activate if @ngrewindow.meter == 1
    @ngrewindow.meter += 1
    refresh_oven
    if @ngrewindow.meter >= @recipes.item[5] * 60
    @ngrewindow.meter = 0
    random = rand(101)
    random <= @recipes.item[3] ? success_producing : fail_producing
    end
    end
    end

    def success_producing
    RPG::SE.new(SuccesProduceSe, 80,).play
    $game_party.gain_item(output_item, @recipes.item[4])
    @type = 'Success!' ; @pop_timer = 50
    destroy_items
    apply_alchemy_growing
    end

    def apply_alchemy_growing
    return if $game_party.alchemy_lv == $game_party.al_maxlv
    return unless $game_party.alchemy_lv <= @recipes.item[6] + SeparateLevel - 1
    if $game_party.alchemy_count == ProductionTimesLevelUp - 1
    r2 = rand(101)
    if r2 <= AlchemyLevelUpChance
    $game_party.alchemy_lv += 1
    RPG::SE.new(AlchemyLevelUpSe, 80,).play
    $game_party.alchemy_count = 0
    refresh_alstatus
    end
    else
    $game_party.alchemy_count += 1
    end
    end

    def fail_producing
    RPG::SE.new(FailProduceSe, 80,).play
    @type = 'Fail!' ; @pop_timer = 50
    destroy_items
    end

    def destroy_items
    c = $data_items[@recipes.item[7]].costitem
    @ngrewindow.ingredients.each {|i|$game_party.lose_item($data_items,c)}
    refresh_ingredients
    refresh_oven
    @ngrewindow.items_ready? ? update_start : @start_window.refresh
    end

    def update_selection
    Sound.play_ok
    @start_window.select(0)
    @start_window.activate
    @recipes.deactivate
    end

    def update_recipe
    return if @recipes.item.nil?
    if @recipe_index != @recipes.index
    @recipe_index = @recipes.index
    refresh_ingredients
    @start_window.refresh if !@start_window.nil?
    refresh_oven
    end
    end

    def terminate
    super
    @recipes.dispose
    @infow.dispose
    @ngrewindow.dispose
    @start_window.dispose
    @oven.dispose
    @alstatus.dispose
    end
    end

    # Input module update engine
    class << Input
    alias falcaoalchemy_mmo_update update
    def Input.update
    update_popwindow2 if !$game_party.nil? and !$game_party.pop_windowdata.nil?
    falcaoalchemy_mmo_update
    end

    # pop window global
    def update_popwindow2
    $game_party.pop_windowdata[0] -= 1 if $game_party.pop_windowdata[0] > 0
    if @temp_window.nil?
    tag = $game_party.pop_windowdata[2]
    string = $game_party.pop_windowdata[1] + tag
    width = (string.length * 9) - 10
    x, y = Graphics.width / 2 - width / 2, Graphics.height / 2 - 64 / 2
    @temp_window = Window_Base.new(x, y, width, 64)
    @temp_window.contents.font.size = 20
    @temp_window.z = 9999
    @temp_window.draw_text(-10, -6, width, 32, tag, 1)
    @temp_window.draw_text(-10,14, width, 32, $game_party.pop_windowdata[1],1)
    @current_scene = SceneManager.scene.class
    end
    if $game_party.pop_windowdata[0] == 0 ||
    @current_scene != SceneManager.scene.class
    @temp_window.dispose
    @temp_window = nil
    $game_party.pop_windowdata = nil
    end
    end
    end

    if FalcaoRGSS_AddAlchemy_to_menu
    class Window_MenuCommand < Window_Command
    alias falcaoadd_alchemy add_original_commands
    def add_original_commands
    add_command('Alchemy', :alchemy, main_commands_enabled)
    falcaoadd_alchemy
    end
    end

    class Scene_Menu < Scene_MenuBase
    alias falcao_alchemy_command create_command_window
    def create_command_window
    falcao_alchemy_command
    @command_window.set_handler(:alchemy, method(:call_alchemy_scene))
    end
    def call_alchemy_scene
    SceneManager.call(Scene_Alchemy)
    end
    end
    end

    ">

     

    Mentre potresti creare un NPC ad eventi ed usare il call script

    SceneManager.call(Scene_Alchemy)

     

     

     

    ">
  8. Dissolvi schermo

    Mostra Picture

    Mostra Schermo :D

     

    Ma mi pare che ci fosse proprio una funzione per il tempo di apparizione :D

    Edit: Ho controllato, non c'è :P

    Se faccio dissolvi schermo c'è sempre quel tempo di apparizione

     

    Se intendi che si vede la mappa sotto semplicemente inizia il gioco su una mappa tutta nera. Le transizioni sono nere quindi non ci si accorge della differenza.

    ^ ^

    Funziona benissimo ^ ^ (Mi hai fatto fissare con questa faccina ehehehe)

     

    Grazie a entrambi

×
×
  • Create New...