Help with Editing a script

Discussion in 'RGSS3 Script Requests' started by Otto, Aug 10, 2018.

  1. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    Howdy,
    Just yesterday I almost accidentally found a script for a Resident Evil-like menu, with limited inventory, combining, etc... and I need help with some editing, mostly three issues, the first is critical and the other two are just a plus.

    The script was a little messy, I don't even know the author because it wasn't signed, and was only partially translated from portoguese to english: here's how it looked like when I first imported the script:

    upload_2018-8-9_19-57-10.png
    *screen from an older version of my project

    Even tho I'm a long time rpg maker user (started with rm2000 and mostly used 2003), when it comes to RGSS I know just enough to barely recognize my a$$ from my elbow, as long as you don't put a hole on my elbow, just to use a colorful example :p .

    Also I can speak english ok but I don't know a single word of portoguese, anyway, after installing the script in a brand new project and messing around with it, I was able to make the inventory look the way I wanted:

    upload_2018-8-9_20-23-12.png

    Windowskin and font are temporary but that's not the problem, that empty box under the inventory box should display the name of the highlighted item, but those of you with a keen eye might I have noticed, it doesn't show anything :(

    Basically what I have done is, edit a certain line from this:
    Code:
    @help_window = RE_Window_Help.new()
    to this:
    Code:
    @help_window = Window_Help.new()
    in order to take the help window from the basic tool's script rather than make this script create its own, because the help window from this particular script was messed up (for some reason item description would all stick on one line and basically loop around the screen, messing up the text), and i modified this part:

    Code:
    #==============================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  Esta janela exibe explicação de habilidades e itens e outras informações.
    #==============================================================================
     
    class RE_Window_Help < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     line_number : número de linhas
      #--------------------------------------------------------------------------
      def initialize(line_number = 3)
        super(0, 150, 345, Graphics.height - 150)
      end
      #--------------------------------------------------------------------------
      # * Configuração de texto
      #     text : texto
      #--------------------------------------------------------------------------
      def set_text(text)
        if text != @text
          @text = text
          refresh
        end
      end
      #--------------------------------------------------------------------------
      # * Limpeza
      #--------------------------------------------------------------------------
      def clear
        set_text("")
      end
      #--------------------------------------------------------------------------
      # * Definição de item
      #     item : habilidades, itens, etc.
      #--------------------------------------------------------------------------
      def set_item(item)
        set_text(item ? item.description : "")
        @item = item
      end
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @item != nil
     
          draw_text(5, 70, 150, 50, RE_MENU::Help_desc)
          draw_text(5, 100, 300, 100, @text)
          draw_text(5, 0 , 350, 50, RE_MENU::Help_name + @item.name)
        end
     
      end
    end
    into this:

    Code:
    #==============================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  Esta janela exibe explicação de habilidades e itens e outras informações.
    #==============================================================================
     
    class RE_Window_Iname < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     line_number : número de linhas
      #--------------------------------------------------------------------------
      def initialize(line_number = 1)
        super(268, 252, 207, 48) # Graphics.height - 384) OTTO
      end
     
      #--------------------------------------------------------------------------
      # * Configuração de texto
      #     text : texto
      #--------------------------------------------------------------------------
      def set_text(text)
        if text != @text
          @text = text
          refresh
        end
      end
      #--------------------------------------------------------------------------
      # * Limpeza
      #--------------------------------------------------------------------------
      def clear
        set_text(" ")
      end
      #--------------------------------------------------------------------------
      # * Definição de item
      #     item : habilidades, itens, etc.
      #--------------------------------------------------------------------------
      def set_item(item)
        set_text(item ? item.description : " ")
        @item = item
      end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @item != nil
          #draw_text(5, 70, 150, 50, RE_MENU::Help_desc)
    #~       draw_text(5, -12, 640, 100, @text)
          draw_text(0, 0 , 207, 48, @item.name) #RE_MENU::Help_name + @item.name)
        end
     
      end
    end
    and basically made the former help window into my own lttile name box, and like I said, the box is there, the item name is not.
    This is where my small knowledge pretty much ends: I basically cloned some script lines that refered to the creation and update/refresh of the old help window and modified them to work with the Iname window (which stands for Item name, in my head lol) but clearly I'm doing it wrong since all I get is a big fat CRASH as soon as I open the menu, in game.

    upload_2018-8-9_20-56-55.png

    dan dan daaaaaaaaan (<- mortal kombat fatality sound)

    So, yes, jokes aside my first and most important request is: How can I prevent the crash and show the item name in the box?

    Also, since I'm here, there's a small, second issue: the item combine system; wile the system itself works flawlessly, there is a small visual/practical issue that I would like to get rid of: basically when i press OK (enter/spacebar/whatever) on the second Item (after selecting the combine option on one item), the Use/Combine window appears again and I have to select combine again. I would like to bypass this part and go directly to the part where the script checks if the combination is possible or not.

    Finally, third Issue: around line 235 I commented out the original string and put this instead: 8 + $game_variables[14]

    this is to control how many spaces you have in the inventory, I set it to 8 basic, plus the ability to expand it with a variable, so far so good, however I would like the original string (@data ? @data.size : 1 - which I think means "I'll highlight as many item as you have" *lol*) to be true for the Files menu (which are basically a key items) since there is no limit to how many files you can carry with you.

    Here's the full script with my editing (under spoiler):
    Code:
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #==============================================================================
    module RE_MENU
       
      #--------------------------------------------------------------------------
      # ENGLISH
      #--------------------------------------------------------------------------
      # * how to create a recipe
      # * place Reciepe[a] = [b, c, d]
      # * a is a crescent number
      # * b and c are the items that will be combined
      # * d is the end item
      #--------------------------------------------------------------------------
      # PORTUGUES   
      #--------------------------------------------------------------------------
      # * receitas de combinações de itens
      # * coloque Reciepe[a] = [b, c, d] sendo
      # * a o valor crescente da receita de 1 a sla quantos
      # * b e c o valor dos intens da receitas que vam combinar
      # * d o item que será formado apartir dos outrs
      #--------------------------------------------------------------------------
    
      Recipe = {}
      Recipe[1] = [12, 13 , 14]
      Recipe[2] = [1, 1, 2]
      #Recipe[3] = [13, 16, 17]
      #Recipe[4] = [15, 14, 17]
      #Recipe[5] = [12, 12, 18]
      #Recipe[6] = [12, 18, 19]
      #--------------------------------------------------------------------------
      # vocabulary
      #--------------------------------------------------------------------------
      Equip = " "
      Discard = " "
      Combine = "Combine"
      Use = "Use"
      Equip = "EQ: "
      Inventary = "Item"
      Key_itens = "Files"
      Help_desc = " "
      Help_name = " "
      Maps = "Maps"
    
      #--------------------------------------------------------------------------
      # * Combine sond
      #--------------------------------------------------------------------------
      def self.playcombine
          Sound.play_use_item
      end
    
    end
    
    #==============================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  Esta janela exibe explicação de habilidades e itens e outras informações.
    #==============================================================================
    
    class RE_Window_Iname < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     line_number : número de linhas
      #--------------------------------------------------------------------------
      def initialize(line_number = 1)
        super(268, 252, 207, 48) # Graphics.height - 384) OTTO
      end
     
      #--------------------------------------------------------------------------
      # * Configuração de texto
      #     text : texto
      #--------------------------------------------------------------------------
      def set_text(text)
        if text != @text
          @text = text
          refresh
        end
      end
      #--------------------------------------------------------------------------
      # * Limpeza
      #--------------------------------------------------------------------------
      def clear
        set_text(" ")
      end
      #--------------------------------------------------------------------------
      # * Definição de item
      #     item : habilidades, itens, etc.
      #--------------------------------------------------------------------------
      def set_item(item)
        set_text(item ? item.description : " ")
        @item = item
      end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @item != nil
          #draw_text(5, 70, 150, 50, RE_MENU::Help_desc)
    #~       draw_text(5, -12, 640, 100, @text)
          draw_text(0, -12 , 207, 48, @item.name) #RE_MENU::Help_name + @item.name)
        end
       
      end
    end
    
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  Esta janela exibe os comandos do menu.
    #==============================================================================
    class MenuCommand < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Inicialização da posição do comando de seleção (método da classe)
      #--------------------------------------------------------------------------
      def self.init_command_position
        @@last_command_symbol = nil
      end
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(268, 72)
      end
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 372
      end
    
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_height
        48
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de linhas exibidas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
      #def visible_line_number
       # 3
      #end
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_main_commands
        add_map_command
        add_game_end_command
      end
      #--------------------------------------------------------------------------
      # * Adição dos comandos principais
      #--------------------------------------------------------------------------
      def add_main_commands
        add_command(RE_MENU::Inventary,   :item,   main_commands_enabled)
        add_command(RE_MENU::Key_itens, :key_item, main_commands_enabled)
      end
    
      #-------------------------------------------------------------------------
      # not sure wtf im doing lol #OTTO
      #-------------------------------------------------------------------------
      def add_map_command
        add_command(RE_MENU::Maps, :maps, main_commands_enabled) #OTTO
      end
      #--------------------------------------
     
      #--------------------------------------------------------------------------
      # * Definição de habilitação dos comandos principais
      #--------------------------------------------------------------------------
      def main_commands_enabled
        $game_party.exists
      end
      #--------------------------------------------------------------------------
      # * Adição do comando de fim do jogo
      #--------------------------------------------------------------------------
      def add_game_end_command
        add_command(Vocab::game_end, :game_end)
      end
      #--------------------------------------------------------------------------
      # * Definição de resultado ao pressionar o botão de confirmação
      #--------------------------------------------------------------------------
      def process_ok
        @@last_command_symbol = current_symbol
        super
      end
      #--------------------------------------------------------------------------
      # * Definição da janela de itens
      #     item_window : janela de itens
      #--------------------------------------------------------------------------
      def item_window=(item_window)
        @item_window = item_window
        @item_window.category = current_symbol
      end
    end
    
    class Window_ItemList < Window_Selectable
      attr_accessor :iname_window  #Thanks TheoAllen
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     x      : coordenada X
      #     y      : coordenada Y
      #     width  : largura
      #     height : altura
      #--------------------------------------------------------------------------
      def initialize(x, y, width, height)
        super(268, 120, 207, 132)
        @category = :none
        @data = []
      end
      #--------------------------------------------------------------------------
      # * Definição de categoria
      #--------------------------------------------------------------------------
      def category=(category)
        return if @category == category
        @category = category
        refresh
        self.oy = 0
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de colunas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
    
      #--------------------------------------------------------------------------
      # * Aquisição do número máximo de itens
      #--------------------------------------------------------------------------
      def item_max
       case @category
        when :item
         8  + $game_variables[14]
        when :key_item
         @data ? @data.size : 1
        else
         1
       end
      end
     
    #~   def item_max
    #~    #8 + $game_variables[14]
    #~     @data ? @data.size : 1 #Max Inventory Slot? Can I use variable? #OTTO
    #~   end
      #--------------------------------------------------------------------------
      # * Aquisição do espaçamento entre os itens
      #--------------------------------------------------------------------------
      def spacing
        return 4
      end
    
      #--------------------------------------------------------------------------
      # * Aquisição de altura do item
      #--------------------------------------------------------------------------
      def item_height
        36
      end
      #--------------------------------------------------------------------------
      # * Aquisição das informações do item
      #--------------------------------------------------------------------------
      def item
        @data && index >= 0 ? @data[index] : nil
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação de seleção
      #--------------------------------------------------------------------------
      def current_item_enabled?
        enable?(@data[index])
      end
      #--------------------------------------------------------------------------
      # * Inclusão do item na lista
      #     item : item
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :item
          item.is_a?(RPG::Item) && !item.key_item? #or item.is_a?(RPG::Weapon)
        when :key_item
          item.is_a?(RPG::Item) && item.key_item?
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Definição de itens disponíveis para uso
      #--------------------------------------------------------------------------
      def usable?(item)
        if item.is_a?(RPG::Weapon)
          return true
        else
          return $game_party.usable?(item)
        end
        return false
       
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação do item
      #     item : item
      #--------------------------------------------------------------------------
      def enable?(item)
        #$game_party.usable?(item)
        return true
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de itens
      #--------------------------------------------------------------------------
      def make_item_list
        @data = $game_party.all_items.select {|item| include?(item) }
        @data.push(nil) if include?(nil)
      end
      #--------------------------------------------------------------------------
      # * Retorno à seleção anterior
      #--------------------------------------------------------------------------
    
      def select_last
        select(@data.index($game_party.last_item.object) || 0)
      end
      #--------------------------------------------------------------------------
      # * desenhar o item
      #--------------------------------------------------------------------------
    
      def draw_item_name(item, x, y, enabled = true, width = 80)
        return unless item
        draw_icon(item.icon_index, x + 10, y + 6, enabled)
        change_color(normal_color, enabled)
    #~     draw_text(x + 5, y + 50, width, line_height, item.name)
      end
      #--------------------------------------------------------------------------
      # * Desenho de um item
      #     index : índice do item
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
       
        if item
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(item, rect.x , rect.y, true)
          rect.y -= 20
          draw_item_number(rect, item) 
        end
      end
    
      #--------------------------------------------------------------------------
      # * Desenho do número de itens possuido
      #     rect : retângulo
      #     item : item
      #--------------------------------------------------------------------------
      def draw_item_number(rect, item)
        draw_text(rect, sprintf(" %2d", $game_party.item_number(item)), 2) #unless it has some tag in the notes??
      end
      #--------------------------------------------------------------------------
      # * Atualização da janela de ajuda
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_item(item)
        @help_window.refresh
        return unless @iname_window
        @iname_window.set_item(item)
        @iname_window.refresh
      end
    
      #--------------------------------------------------------------------------
      # * Update Item Name #OTTO
      #--------------------------------------------------------------------------
    #~   def update_iname
    #~     @iname_window.set_item(item)
    #~     @iname_window.refresh
    #~   end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        make_item_list
        create_contents
        draw_all_items
        update_help
    #~     update_iname
      end
    end
    
    class Comand_itens < Window_Command
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(168, 120)
        refresh
      end
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 100
      end
      def window_height
        return 76
      end
      def activeCombine=(active)
        @activecombine = active
      end
      def usename=(name)
        @usename = name
      end
      def activeCombine
        return @activecombine
      end
      def usename
        return @usename
      end
      def important=(value)
        @important = value
      end
      def important
        return @important
      end
      def isuse=(value)
        @isuse = value
      end
      def isuse
        return @isuse
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(usename,   :usar,   isuse)
        add_command(RE_MENU::Combine,  :combine,  activeCombine)
    #~     add_command(RE_MENU::Discard,  :discart,  important)
      end
    end
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Inicialização do processo
      #--------------------------------------------------------------------------
      def start
        super
        create_Help_window
        create_command_window
        create_item_window
        create_Iname_window
        create_status_window
        create_command_itens
        create_Equip_window
        @iscombine = false
        @actor = $game_party.members[0]
      end
    
      #--------------------------------------------------------------------------
      # * Criação da janela de comando
      #--------------------------------------------------------------------------
      def create_command_window
        @command_window = MenuCommand.new
        @command_window.set_handler(:item,      method(:command_item))
        @command_window.set_handler(:key_item,      method(:command_item))
        @command_window.set_handler(:game_end,  method(:command_game_end))
        @command_window.set_handler(:cancel,    method(:return_scene))
      end
       
      #--------------------------------------------------------------------------
      # * Criação da janela de itens
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @command_window.y + @command_window.height + 100
        wh = Graphics.height - wy
        @item_window = Window_ItemList.new(344, wy, 200, wh)
        @item_window.help_window = @help_window
        @item_window.set_handler(:ok,     method(:on_item_ok))
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @command_window.item_window = @item_window
        @command_window.item_window = @item_window
      end
      #--------------------------------------------------------------------------
      # * Criação da janela de comando dos intems
      #--------------------------------------------------------------------------
      def create_command_itens
        @command_item = Comand_itens.new
        @command_item.set_handler(:usar,      method(:use_item))
        @command_item.set_handler(:combine,      method(:combine_item))
        @command_item.set_handler(:discart,  method(:discart_item))
        @command_item.set_handler(:cancel,    method(:return_itens))
        @command_item.visible = false
        @command_item.active = false
      end
    
      #--------------------------------------------------------------------------
      # * Criação das janelas #Position for Status and Equip #OTTO
      #--------------------------------------------------------------------------
      def create_status_window
        @Status_window = Window_Base.new(475,120,165,84)
        @Status_window.contents.clear
    #~     @Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 0, 32, 120)
      end
    
      def create_Help_window
        @help_window = Window_Help.new() #RE_Window_Help.new()
      end
     
      def create_Iname_window #OTTO
        @ihelp_window = RE_Window_Iname.new()
        @item_window.iname_window = @ihelp_window
      end
     
      def create_Equip_window
        @Equip_window = Window_Base.new(475,204,165,48)
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
          #INSERT CURRENT / REMAINING AMMO HERE # OTTO
    #~       @Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
       
       
      end
      def use_item
        if @item.is_a?(RPG::Weapon)
          @actor.change_equip(0,@item)
          Sound.play_equip
        else
          Sound.play_use_item
          @actor.use_item(@item)
          use_item_to_actors
         
        end
        return_itens
        refresh
        check_common_event
      end
      def use_item_to_actors
        $game_party.members.each do |target|
          @item.repeats.times { target.item_apply(@actor, @item) }
        end
      end
      def check_common_event
        if $game_temp.common_event_reserved?
          SceneManager.goto(Scene_Map)
          @iscombine = false
        end
      end
      def combine_item
        if @iscombine == false
          @iscombine = true
          @combineitem = @item
        else
          recipe = RE_MENU::Recipe
          if @combineitem.id == @item.template_id
            if $game_party.item_number(@item) <= 1
              @combineitem = nil
            end
          end
          if @combineitem != nil
            for x in 1..recipe.size
            recipe1 = recipe[x]
           
              if recipe1[0] == @combineitem.template_id and recipe1[1] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              elsif recipe1[1] == @combineitem.template_id and recipe1[0] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              end
            end
          end
          if @iscombine == true
            Sound.play_buzzer
              @iscombine = false
          end
         
        end
        refresh
        return_itens
       
       
      end
      def combineitens(x)
        RE_MENU::playcombine
        $game_party.gain_item(@item, -1, true)
        $game_party.gain_item(@combineitem, -1, true)
        for y in 0..$data_items.size
            novoitem = $data_items[y] if y == RE_MENU::Recipe[x][2]
        end
        $game_party.gain_item(novoitem, 1)
      end
      def discart_item
        $game_party.gain_item(@item, -1, true)
        return_itens
      end
      def return_itens
        @command_item.visible = false
        @command_item.active = false
        @item_window.active = true
        @item_window.refresh
      end
      #--------------------------------------------------------------------------
      # * Item [Confirmação]
      #--------------------------------------------------------------------------
      def on_item_ok
        @item = @item_window.item
        if @item != nil
          if @item.is_a?(RPG::Weapon)
            @command_item.activeCombine = false
            @command_item.usename = RE_MENU::Equip
          else
            @command_item.activeCombine = true
            @command_item.usename = RE_MENU::Use
          end
          if @item.is_a?(RPG::Item) and @item.key_item?
            @command_item.important = false
          else
            @command_item.important = true
          end
          if @item_window.usable?(@item)
            @command_item.isuse = true
          else
            @command_item.isuse = false
          end
         
          @command_item.refresh
          @command_item.visible = true
          @command_item.active = true
        else
          Sound.play_buzzer
          @item_window.active = true
        end
        @help_window.set_item(@item)
      end
      #--------------------------------------------------------------------------
      # * Item [Cancelamento]
      #--------------------------------------------------------------------------
      def on_item_cancel
        @item_window.unselect
        @command_window.activate
        @iscombine = false
      end
    
      #--------------------------------------------------------------------------
      # * Comando [Item]
      #--------------------------------------------------------------------------
      def command_item
        @command_window.item_window = @item_window
        @item_window.activate
        @item_window.select_last
       
      end
      #--------------------------------------------------------------------------
      # Trying to add a Maps command #OTTO
      #--------------------------------------------------------------------------
      def command_maps
        SceneManager.call(Scene_Map)
      end
      #--------------------------------------------------------------------------
      # * Comando [Fim do Jogo]
      #--------------------------------------------------------------------------
      def command_game_end
        SceneManager.call(Scene_End)
      end
      #--------------------------------------------------------------------------
      # * Comandos individuais [Cancelamento]
      #--------------------------------------------------------------------------
      def on_personal_cancel
        @status_window.unselect
        @command_window.activate
      end
    
      def refresh
        @actor = $game_party.members[0]
        @item_window.refresh
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
    #~       @Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
        @Status_window.contents.clear
    #~     @Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 100, 40, 120)
      end
    end
    

    To make it work without crash you have to comment out the following lines:
    355, 356, 357, 358, 368
    otherwise you get the crash error shown in the screenshot.

    Thanks in advance to anyone who will look into it, and sorry for the long post.

    PS: does anyone know the name of the author? I would like to - at the very least - credit him/her.
     
    Last edited: Aug 11, 2018
    #1
  2. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    2,753
    Likes Received:
    2,740
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Disclaimer, I didn't read your entire post, I skipped to the error part and looked at the code.
    I saw these code, Tried to search the @iname_window and it never been defined
    Screenshot_359.png
    What are you implying? Is it supposed to be a help window?

    Edit: Oh snap, apparently I need to comment out some lines, so nvm.
    I think you were adding some unnecessary information, but ok.
     

    Attached Files:

    #2
    Otto likes this.
  3. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    Not really, but I edited part of the code that was originally designed to create the help window for this menu, which didn't work anyway (wierd text wrapping bug) to instead turn it into a "Show Item Name Window" located under the inventory box, then I "forced" (not sure if it's the correct word, sorry, I don't know much about scripting) the script to load the normal help window that you would find in a standard menu.

    The issue is that the Item Name doesn't show up in that box, and the game crashes (unless i comment/delete those lines that I added up)

    If you are asking me what was the logic behind the lines that I added... there was none :p
    I'm no scripter, I just went with instinct and various attempts, I was actually amazed that I was able to edit all this stuff before reaching a dead end lol
     
    #3
  4. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    2,753
    Likes Received:
    2,740
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Here is your hugest mistake.
    Screenshot_361.png
    Change it to this would be fine
    Screenshot_363.png
    Of course you also need to make a method to assign the window itself
    Screenshot_364.png
    Then move the entire update method here
    Screenshot_360.png
     
    #4
    Zeriab and Otto like this.
  5. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    IT WORKED!!

    upload_2018-8-10_1-40-2.png

    That's perfect! Thanks for your help man :)

    PS: I recognized your name, you're the man who created the Limited Inventory Script, which I actually use in this very same game (because this menu script does give you the resident evil-ish inventory but doesn't actually prevent you from adding more item than allowed :p )
     
    #5
  6. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    2,753
    Likes Received:
    2,740
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Glad it worked. I suffered the same when I was still learning the same as well, it happened on limited inventory, about updating the window that display the slot when the item is changed. Wasn't easy.

    Anyway, you probably gonna figure out it yourself if you want to mix my script with this one :p can't vouch if it will works, but idk.
     
    #6
    Otto likes this.
  7. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    I'll give it a shot later, 'tho if I'm able to fix Issue #3 I might not need it, because the player technically could never select more slots than he has.

    *issue #3:
    (yes I'm shamelessly bumping my own post LOL)
     
    #7
  8. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    376
    Likes Received:
    285
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    N/A
    You should be able to do something like:
    Code:
    def item_max
      case @category
      when :item
        8 + $game_variables[14]
      when :maps
        @data ? @data.size : 1
      else
        #blah blah
      end
    end
     
    #8
    Otto likes this.
  9. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    I added this:
    Code:
    def item_max
      case @category
       when :item
        8  + $game_variables[14]
       when :key_item
        @data ? @data.size : 1
      end
    end
    but unfortunately I got a crash :(

    upload_2018-8-10_12-12-37.png

    this is the script and the line that the error is refering about:

    upload_2018-8-10_12-13-35.png

    note: I never actually touched this specific script O:
     
    #9
  10. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    376
    Likes Received:
    285
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    N/A
    Without testing it out for myself, I'm not too sure. Try this instead:
    Code:
    def item_max
      case @category
      when :item
        8  + $game_variables[14]
      when :key_item
        @data ? @data.size : 1
      else
        1
      end
    end
    The reason being that if your category is anything other than :item or :key_item, the value will return nil, and you can't add or subtract from nil.
     
    #10
    Otto likes this.
  11. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    @A-Moonless-Night

    That actually worked!
    Thanks for your help :) :) :)

    @Everyone :p

    that leaves just one more thing then this case is closed lol

    Quote from my first post:
    Also, since I'm here, there's a small, second issue: the item combine system; wile the system itself works flawlessly(*I even managed to make it work alongside the Instance Item because I'm a total badass **no I'm not, I literally guessed it by pure chance LOL), there is a small visual/practical issue that I would like to get rid of: basically when i press OK (enter/spacebar/whatever) on the second Item (after selecting the combine option on one item), the Use/Combine window appears again and I have to select combine again. I would like to bypass this part and go directly to the part where the script checks if the combination is possible or not. (*I also noticed a bug that Turns the hero name Blue after I select Combine for the first time, and leaves it blue untill I exit the menu and reopen it)

    I updated the script with all the new modification added:

    Code:
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #==============================================================================
    module RE_MENU
        
      #--------------------------------------------------------------------------
      # ENGLISH
      #--------------------------------------------------------------------------
      # * how to create a recipe
      # * place Reciepe[a] = [b, c, d]
      # * a is a crescent number
      # * b and c are the items that will be combined
      # * d is the end item
      #--------------------------------------------------------------------------
      # PORTUGUES   
      #--------------------------------------------------------------------------
      # * receitas de combinações de itens
      # * coloque Reciepe[a] = [b, c, d] sendo
      # * a o valor crescente da receita de 1 a sla quantos
      # * b e c o valor dos intens da receitas que vam combinar
      # * d o item que será formado apartir dos outrs
      #--------------------------------------------------------------------------
     
      Recipe = {}
      Recipe[1] = [12, 13 , 14]
      Recipe[2] = [1, 1, 2]
      #Recipe[3] = [13, 16, 17]
      #Recipe[4] = [15, 14, 17]
      #Recipe[5] = [12, 12, 18]
      #Recipe[6] = [12, 18, 19]
      #--------------------------------------------------------------------------
      # vocabulary
      #--------------------------------------------------------------------------
      Equip = " "
      Discard = " "
      Combine = "Combine"
      Use = "Use"
      Equip = "EQ: "
      Inventary = "Item"
      Key_itens = "Files"
      Help_desc = " "
      Help_name = " "
      Maps = "Maps"
     
      #--------------------------------------------------------------------------
      # * Combine sond
      #--------------------------------------------------------------------------
      def self.playcombine
          Sound.play_use_item
      end
     
    end
     
    #==============================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  Esta janela exibe explicação de habilidades e itens e outras informações.
    #==============================================================================
     
    class RE_Window_Iname < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     line_number : número de linhas
      #--------------------------------------------------------------------------
      def initialize(line_number = 1)
        super(268, 252, 207, 48) # Graphics.height - 384) OTTO
      end
     
      #--------------------------------------------------------------------------
      # * Configuração de texto
      #     text : texto
      #--------------------------------------------------------------------------
      def set_text(text)
        if text != @text
          @text = text
          refresh
        end
      end
      #--------------------------------------------------------------------------
      # * Limpeza
      #--------------------------------------------------------------------------
      def clear
        set_text(" ")
      end
      #--------------------------------------------------------------------------
      # * Definição de item
      #     item : habilidades, itens, etc.
      #--------------------------------------------------------------------------
      def set_item(item)
        set_text(item ? item.description : " ")
        @item = item
      end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @item != nil
          #draw_text(5, 70, 150, 50, RE_MENU::Help_desc)
    #~       draw_text(5, -12, 640, 100, @text)
          draw_text(0, -12 , 207, 48, @item.name) #RE_MENU::Help_name + @item.name)
        end
      
      end
    end
    
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  Esta janela exibe os comandos do menu.
    #==============================================================================
    class MenuCommand < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Inicialização da posição do comando de seleção (método da classe)
      #--------------------------------------------------------------------------
      def self.init_command_position
        @@last_command_symbol = nil
      end
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(268, 72)
      end
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 372
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_height
        48
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de linhas exibidas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
      #def visible_line_number
       # 3
      #end
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_main_commands
        add_map_command
        add_game_end_command
      end
      #--------------------------------------------------------------------------
      # * Adição dos comandos principais
      #--------------------------------------------------------------------------
      def add_main_commands
        add_command(RE_MENU::Inventary,   :item,   main_commands_enabled)
        add_command(RE_MENU::Key_itens, :key_item, main_commands_enabled)
      end
     
      #-------------------------------------------------------------------------
      # not sure wtf im doing lol #OTTO
      #-------------------------------------------------------------------------
      def add_map_command
        add_command(RE_MENU::Maps, :maps, main_commands_enabled) #OTTO
      end
      #--------------------------------------
     
      #--------------------------------------------------------------------------
      # * Definição de habilitação dos comandos principais
      #--------------------------------------------------------------------------
      def main_commands_enabled
        $game_party.exists
      end
      #--------------------------------------------------------------------------
      # * Adição do comando de fim do jogo
      #--------------------------------------------------------------------------
      def add_game_end_command
        add_command(Vocab::game_end, :game_end)
      end
      #--------------------------------------------------------------------------
      # * Definição de resultado ao pressionar o botão de confirmação
      #--------------------------------------------------------------------------
      def process_ok
        @@last_command_symbol = current_symbol
        super
      end
      #--------------------------------------------------------------------------
      # * Definição da janela de itens
      #     item_window : janela de itens
      #--------------------------------------------------------------------------
      def item_window=(item_window)
        @item_window = item_window
        @item_window.category = current_symbol
      end
    end
     
    class Window_ItemList < Window_Selectable
      attr_accessor :iname_window  #Thanks TheoAllen
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     x      : coordenada X
      #     y      : coordenada Y
      #     width  : largura
      #     height : altura
      #--------------------------------------------------------------------------
      def initialize(x, y, width, height)
        super(268, 120, 207, 132)
        @category = :none
        @data = []
      end
      #--------------------------------------------------------------------------
      # * Definição de categoria
      #--------------------------------------------------------------------------
      def category=(category)
        return if @category == category
        @category = category
        refresh
        self.oy = 0
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de colunas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição do número máximo de itens
      #--------------------------------------------------------------------------
      def item_max
       case @category
        when :item
         8  + $game_variables[14]
        when :key_item
         @data ? @data.size : 1
        else
         1
       end
      end
     
    #~   def item_max
    #~    #8 + $game_variables[14]
    #~     @data ? @data.size : 1 #Max Inventory Slot? Can I use variable? #OTTO
    #~   end
      #--------------------------------------------------------------------------
      # * Aquisição do espaçamento entre os itens
      #--------------------------------------------------------------------------
      def spacing
        return 4
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição de altura do item
      #--------------------------------------------------------------------------
      def item_height
        36
      end
      #--------------------------------------------------------------------------
      # * Aquisição das informações do item
      #--------------------------------------------------------------------------
      def item
        @data && index >= 0 ? @data[index] : nil
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação de seleção
      #--------------------------------------------------------------------------
      def current_item_enabled?
        enable?(@data[index])
      end
      #--------------------------------------------------------------------------
      # * Inclusão do item na lista
      #     item : item
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :item
          item.is_a?(RPG::Item) && !item.key_item? #or item.is_a?(RPG::Weapon)
        when :key_item
          item.is_a?(RPG::Item) && item.key_item?
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Definição de itens disponíveis para uso
      #--------------------------------------------------------------------------
      def usable?(item)
        if item.is_a?(RPG::Weapon)
          return true
        else
          return $game_party.usable?(item)
        end
        return false
      
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação do item
      #     item : item
      #--------------------------------------------------------------------------
      def enable?(item)
        #$game_party.usable?(item)
        return true
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de itens
      #--------------------------------------------------------------------------
      def make_item_list
        @data = $game_party.all_items.select {|item| include?(item) }
        @data.push(nil) if include?(nil)
      end
      #--------------------------------------------------------------------------
      # * Retorno à seleção anterior
      #--------------------------------------------------------------------------
     
      def select_last
        select(@data.index($game_party.last_item.object) || 0)
      end
      #--------------------------------------------------------------------------
      # * desenhar o item
      #--------------------------------------------------------------------------
     
      def draw_item_name(item, x, y, enabled = true, width = 80)
        return unless item
        draw_icon(item.icon_index, x + 10, y + 6, enabled)
        change_color(normal_color, enabled)
    #~     draw_text(x + 5, y + 50, width, line_height, item.name)
      end
      #--------------------------------------------------------------------------
      # * Desenho de um item
      #     index : índice do item
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
      
        if item
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(item, rect.x , rect.y, true)
          rect.y -= 20
          draw_item_number(rect, item)
        end
      end
     
      #--------------------------------------------------------------------------
      # * Desenho do número de itens possuido
      #     rect : retângulo
      #     item : item
      #--------------------------------------------------------------------------
      def draw_item_number(rect, item)
        draw_text(rect, sprintf(" %2d", $game_party.item_number(item)), 2) #unless it has some tag in the notes??
      end
      #--------------------------------------------------------------------------
      # * Atualização da janela de ajuda
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_item(item)
        @help_window.refresh
        return unless @iname_window
        @iname_window.set_item(item)
        @iname_window.refresh
      end
     
      #--------------------------------------------------------------------------
      # * Update Item Name #OTTO
      #--------------------------------------------------------------------------
    #~   def update_iname
    #~     @iname_window.set_item(item)
    #~     @iname_window.refresh
    #~   end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        make_item_list
        create_contents
        draw_all_items
        update_help
    #~     update_iname
      end
    end
     
    class Comand_itens < Window_Command
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(168, 120)
        refresh
      end
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 100
      end
      def window_height
        return 76
      end
      def activeCombine=(active)
        @activecombine = active
      end
      def usename=(name)
        @usename = name
      end
      def activeCombine
        return @activecombine
      end
      def usename
        return @usename
      end
      def important=(value)
        @important = value
      end
      def important
        return @important
      end
      def isuse=(value)
        @isuse = value
      end
      def isuse
        return @isuse
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(usename,   :usar,   isuse)
        add_command(RE_MENU::Combine,  :combine,  activeCombine)
    #~     add_command(RE_MENU::Discard,  :discart,  important)
      end
    end
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Inicialização do processo
      #--------------------------------------------------------------------------
      def start
        super
        create_Help_window
        create_command_window
        create_item_window
        create_Iname_window
        create_status_window
        create_command_itens
        create_Equip_window
        @iscombine = false
        @actor = $game_party.members[0]
      end
     
      #--------------------------------------------------------------------------
      # * Criação da janela de comando
      #--------------------------------------------------------------------------
      def create_command_window
        @command_window = MenuCommand.new
        @command_window.set_handler(:item,      method(:command_item))
        @command_window.set_handler(:key_item,      method(:command_item))
        @command_window.set_handler(:game_end,  method(:command_game_end))
        @command_window.set_handler(:cancel,    method(:return_scene))
      end
      
      #--------------------------------------------------------------------------
      # * Criação da janela de itens
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @command_window.y + @command_window.height + 100
        wh = Graphics.height - wy
        @item_window = Window_ItemList.new(344, wy, 200, wh)
        @item_window.help_window = @help_window
        @item_window.set_handler(:ok,     method(:on_item_ok))
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @command_window.item_window = @item_window
        @command_window.item_window = @item_window
      end
      #--------------------------------------------------------------------------
      # * Criação da janela de comando dos intems
      #--------------------------------------------------------------------------
      def create_command_itens
        @command_item = Comand_itens.new
        @command_item.set_handler(:usar,      method(:use_item))
        @command_item.set_handler(:combine,      method(:combine_item))
        @command_item.set_handler(:discart,  method(:discart_item))
        @command_item.set_handler(:cancel,    method(:return_itens))
        @command_item.visible = false
        @command_item.active = false
      end
     
      #--------------------------------------------------------------------------
      # * Criação das janelas #Position for Status and Equip #OTTO
      #--------------------------------------------------------------------------
      def create_status_window
        @Status_window = Window_Base.new(475,120,165,84)
        @Status_window.contents.clear
    #~     @Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 0, 32, 120)
      end
     
      def create_Help_window
        @help_window = Window_Help.new() #RE_Window_Help.new()
      end
     
      def create_Iname_window #OTTO
        @ihelp_window = RE_Window_Iname.new()
        @item_window.iname_window = @ihelp_window
      end
     
      def create_Equip_window
        @Equip_window = Window_Base.new(475,204,165,48)
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
          #INSERT CURRENT / REMAINING AMMO HERE # OTTO
    #~       @Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
      
      
      end
      def use_item
        if @item.is_a?(RPG::Weapon)
          @actor.change_equip(0,@item)
          Sound.play_equip
        else
          Sound.play_use_item
          @actor.use_item(@item)
          use_item_to_actors
        
        end
        return_itens
        refresh
        check_common_event
      end
      def use_item_to_actors
        $game_party.members.each do |target|
          @item.repeats.times { target.item_apply(@actor, @item) }
        end
      end
      def check_common_event
        if $game_temp.common_event_reserved?
          SceneManager.goto(Scene_Map)
          @iscombine = false
        end
      end
      def combine_item
        if @iscombine == false
          @iscombine = true
          @combineitem = @item
        else
          recipe = RE_MENU::Recipe
          if @combineitem.id == @item.template_id
            if $game_party.item_number(@item) <= 1
              @combineitem = nil
            end
          end
          if @combineitem != nil
            for x in 1..recipe.size
            recipe1 = recipe[x]
          
              if recipe1[0] == @combineitem.template_id and recipe1[1] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              elsif recipe1[1] == @combineitem.template_id and recipe1[0] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              end
            end
          end
          if @iscombine == true
            Sound.play_buzzer
              @iscombine = false
          end
        
        end
        refresh
        return_itens
      
      
      end
      def combineitens(x)
        RE_MENU::playcombine
        $game_party.gain_item(@item, -1, true)
        $game_party.gain_item(@combineitem, -1, true)
        for y in 0..$data_items.size
            novoitem = $data_items[y] if y == RE_MENU::Recipe[x][2]
        end
        $game_party.gain_item(novoitem, 1)
      end
      def discart_item
        $game_party.gain_item(@item, -1, true)
        return_itens
      end
      def return_itens
        @command_item.visible = false
        @command_item.active = false
        @item_window.active = true
        @item_window.refresh
      end
      #--------------------------------------------------------------------------
      # * Item [Confirmação]
      #--------------------------------------------------------------------------
      def on_item_ok
        @item = @item_window.item
        if @item != nil
          if @item.is_a?(RPG::Weapon)
            @command_item.activeCombine = false
            @command_item.usename = RE_MENU::Equip
          else
            @command_item.activeCombine = true
            @command_item.usename = RE_MENU::Use
          end
          if @item.is_a?(RPG::Item) and @item.key_item?
            @command_item.important = false
          else
            @command_item.important = true
          end
          if @item_window.usable?(@item)
            @command_item.isuse = true
          else
            @command_item.isuse = false
          end
        
          @command_item.refresh
          @command_item.visible = true
          @command_item.active = true
        else
          Sound.play_buzzer
          @item_window.active = true
        end
        @help_window.set_item(@item)
      end
      #--------------------------------------------------------------------------
      # * Item [Cancelamento]
      #--------------------------------------------------------------------------
      def on_item_cancel
        @item_window.unselect
        @command_window.activate
        @iscombine = false
      end
     
      #--------------------------------------------------------------------------
      # * Comando [Item]
      #--------------------------------------------------------------------------
      def command_item
        @command_window.item_window = @item_window
        @item_window.activate
        @item_window.select_last
      
      end
      #--------------------------------------------------------------------------
      # Trying to add a Maps command #OTTO
      #--------------------------------------------------------------------------
      def command_maps
        SceneManager.call(Scene_Map)
      end
      #--------------------------------------------------------------------------
      # * Comando [Fim do Jogo]
      #--------------------------------------------------------------------------
      def command_game_end
        SceneManager.call(Scene_End)
      end
      #--------------------------------------------------------------------------
      # * Comandos individuais [Cancelamento]
      #--------------------------------------------------------------------------
      def on_personal_cancel
        @status_window.unselect
        @command_window.activate
      end
     
      def refresh
        @actor = $game_party.members[0]
        @item_window.refresh
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
    #~       @Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
        @Status_window.contents.clear
    #~     @Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 100, 40, 120)
      end
    end
     
    Last edited: Aug 11, 2018
    #11
  12. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    376
    Likes Received:
    285
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    N/A
    Hmm, it's not pretty, but you could do this:
    Code:
    def on_item_ok
        @item = @item_window.item
        if @item != nil
          if @iscombine && @item.is_a?(RPG::Item) && !@item.key_item?
            combine_item
          else
            if @item.is_a?(RPG::Weapon)
              @command_item.activeCombine = false
              @command_item.usename = RE_MENU::Equip
            else
              @command_item.activeCombine = true
              @command_item.usename = RE_MENU::Use
            end
            if @item.is_a?(RPG::Item) and @item.key_item?
              @command_item.important = false
            else
              @command_item.important = true
            end
            if @item_window.usable?(@item)
              @command_item.isuse = true
            else
              @command_item.isuse = false
            end
            @command_item.refresh
            @command_item.visible = true
            @command_item.active = true
          end
        else
          Sound.play_buzzer
          @item_window.active = true
        end
        @help_window.set_item(@item)
      end
     
    #12
    Otto likes this.
  13. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    Might not be pretty but... IT WORKED!! :D

    Thanks again :) that leaves only the "name turning blue" bug but it's not big deal, I'm sure it's just a string here somewhere.

    I actually wouldn't mind some "visual" indication, for the player, that I'm combining an item... maybe I'll look for a way to have the icon or the name of the first item appear somewhere, but that's a request for another time I guess... :)

    Thanks to Theo Allen and A-Moonless-Night for helping out :)
     
    #13
  14. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    376
    Likes Received:
    285
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    N/A
    I can't really see anything that should change the colour, unless you have another script that alters the menu scene? Anyway, put this before you draw the actor's name and see if that fixes it.
    Code:
    change_color(normal_color, enabled)
     
    #14
    Otto likes this.
  15. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    doesn't work :(

    i put that string before the two instances in which the script draws the actor name, and I got this crash error:

    *cant' post screenshot because of server error, but the crash message says: "undefined local variable or method 'normal_color' for #<scene_menu:0xc2972e4> "

    This happens as soon as I open the menu.
     
    #15
  16. A-Moonless-Night

    A-Moonless-Night WINTER IS COMING Veteran

    Messages:
    376
    Likes Received:
    285
    Location:
    New Zealand
    First Language:
    English
    Primarily Uses:
    N/A
    Oh, sorry, didn't realise that was all being drawn in Scene_Menu. That's kinda strange. Try:
    Code:
    @Status_window.change_color(@Status_window.normal_color)
     
    #16
    Otto likes this.
  17. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    Thanks, it works perfectly now! :D
     
    #17
  18. Otto

    Otto Veteran Veteran

    Messages:
    91
    Likes Received:
    26
    Location:
    Italy
    First Language:
    Engilsh
    Primarily Uses:
    RM2k3
    Sorry to bring this up again, but I just found a new bug, which was probably already part of the script itself, even before I edited (also with big help by Theo and Moonless).

    I want some item to be combinable with other instances of the same item, to make a better version of themselves, similar to what you did in Resident Evil by combining two green herbs together (you basically do it to have better healing wile saving inventory slots at the same time).
    In this script it's already possible to use the same ID for both ingredients, however the problem is that I can actually combine one "Green Herb" with itself (literally, I can create a "Double Green Herb" with having only 1 "Green Herb" in the inventory LOL)

    Is there a way to fix this?

    Here's the script with the most recent modifications:

    Code:
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #==============================================================================
    module RE_MENU
        
      #--------------------------------------------------------------------------
      # ENGLISH
      #--------------------------------------------------------------------------
      # * how to create a recipe
      # * place Reciepe[a] = [b, c, d]
      # * a is a crescent number
      # * b and c are the items that will be combined
      # * d is the end item
      #--------------------------------------------------------------------------
      # PORTUGUES   
      #--------------------------------------------------------------------------
      # * receitas de combinações de itens
      # * coloque Reciepe[a] = [b, c, d] sendo
      # * a o valor crescente da receita de 1 a sla quantos
      # * b e c o valor dos intens da receitas que vam combinar
      # * d o item que será formado apartir dos outrs
      #--------------------------------------------------------------------------
     
      Recipe = {}
      Recipe[1] = [12, 13 , 14]
      Recipe[2] = [1, 1, 2]
      #Recipe[3] = [13, 16, 17]
      #Recipe[4] = [15, 14, 17]
      #Recipe[5] = [12, 12, 18]
      #Recipe[6] = [12, 18, 19]
      #--------------------------------------------------------------------------
      # vocabulary
      #--------------------------------------------------------------------------
      Equip = " "
      Discard = " "
      Combine = "Combine"
      Use = "Use"
      Equip = "EQ: "
      Inventary = "Item"
      Key_itens = "Files"
      Help_desc = " "
      Help_name = " "
      Maps = "Maps"
     
      #--------------------------------------------------------------------------
      # * Combine sond
      #--------------------------------------------------------------------------
      def self.playcombine
          Sound.play_use_item
      end
     
    end
    
    #OTTO Create Image for Background!!
    
      def create_Image_Background
        $sfondo = Sprite.new
        $sfondo.bitmap = Cache.system("Menu_"+$game_variables[10].to_s)
        
        $sfondo.x = 0
        $sfondo.y = 0
        #$sfondo.z =
        $sfondo.opacity = 255
        
      end
     
    #==============================================================================
    # ** Window_Help now turned into Item Name by Otto
    #------------------------------------------------------------------------------
    #  Esta janela exibe explicação de habilidades e itens e outras informações.
    #==============================================================================
    
    
    class RE_Window_Iname < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     line_number : número de linhas
      #--------------------------------------------------------------------------
      def initialize(line_number = 1)
        super(268, 252, 207, 48) # Graphics.height - 384) OTTO (252)
      end
     
      #--------------------------------------------------------------------------
      # * Configuração de texto
      #     text : texto
      #--------------------------------------------------------------------------
      def set_text(text)
        if text != @text
          @text = text
          refresh
        end
      end
      #--------------------------------------------------------------------------
      # * Limpeza
      #--------------------------------------------------------------------------
      def clear
        set_text(" ")
      end
      #--------------------------------------------------------------------------
      # * Definição de item
      #     item : habilidades, itens, etc.
      #--------------------------------------------------------------------------
      def set_item(item)
        set_text(item ? item.description : " ")
        @item = item
      end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @item != nil
          #draw_text(5, 70, 150, 50, RE_MENU::Help_desc)
    #~       draw_text(5, -12, 640, 100, @text)
          draw_text(0, -12 , 207, 48, @item.name) #RE_MENU::Help_name + @item.name)
        end
      
      end
    end
    
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  Esta janela exibe os comandos do menu.
    #==============================================================================
    class MenuCommand < Window_HorzCommand
      #--------------------------------------------------------------------------
      # * Inicialização da posição do comando de seleção (método da classe)
      #--------------------------------------------------------------------------
      def self.init_command_position
        @@last_command_symbol = nil
      end
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(268, 72)
      end
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 372
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_height
        48
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de linhas exibidas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
      #def visible_line_number
       # 3
      #end
     
     
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_main_commands
        add_map_command
        add_game_end_command
      end
      #--------------------------------------------------------------------------
      # * Adição dos comandos principais
      #--------------------------------------------------------------------------
      def add_main_commands
        add_command(RE_MENU::Inventary,   :item,   main_commands_enabled)
        add_command(RE_MENU::Key_itens, :key_item, main_commands_enabled)
      end
     
      #-------------------------------------------------------------------------
      # not sure wtf im doing lol #OTTO
      #-------------------------------------------------------------------------
      def add_map_command
        add_command(RE_MENU::Maps, :maps, main_commands_enabled) #OTTO
      end
      #--------------------------------------
     
      #--------------------------------------------------------------------------
      # * Definição de habilitação dos comandos principais
      #--------------------------------------------------------------------------
      def main_commands_enabled
        $game_party.exists
      end
      #--------------------------------------------------------------------------
      # * Adição do comando de fim do jogo
      #--------------------------------------------------------------------------
      def add_game_end_command
        add_command(Vocab::game_end, :game_end)
      end
      #--------------------------------------------------------------------------
      # * Definição de resultado ao pressionar o botão de confirmação
      #--------------------------------------------------------------------------
      def process_ok
        @@last_command_symbol = current_symbol
        super
      end
      #--------------------------------------------------------------------------
      # * Definição da janela de itens
      #     item_window : janela de itens
      #--------------------------------------------------------------------------
      def item_window=(item_window)
        @item_window = item_window
        @item_window.category = current_symbol
      end
     
    end
     
    class Window_ItemList < Window_Selectable
      attr_accessor :iname_window  #Thanks TheoAllen
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #     x      : coordenada X
      #     y      : coordenada Y
      #     width  : largura
      #     height : altura
      #--------------------------------------------------------------------------
      def initialize(x, y, width, height)
        super(268, 120, 207, 132)
        @category = :none
        @data = []
      end
      #--------------------------------------------------------------------------
      # * Definição de categoria
      #--------------------------------------------------------------------------
      def category=(category)
        return if @category == category
        @category = category
        refresh
        self.oy = 0
      end
      #--------------------------------------------------------------------------
      # * Aquisição do número de colunas
      #--------------------------------------------------------------------------
      def col_max
        return 4
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição do número máximo de itens
      #--------------------------------------------------------------------------
      def item_max
       case @category
        when :item
         8  + $game_variables[14]
        when :key_item
         @data ? @data.size : 1
        else
         @data ? @data.size : 1
       end
      end
     
    #~   def item_max
    #~    #8 + $game_variables[14]
    #~     @data ? @data.size : 1 #Max Inventory Slot? Can I use variable? #OTTO
    #~   end
      #--------------------------------------------------------------------------
      # * Aquisição do espaçamento entre os itens
      #--------------------------------------------------------------------------
      def spacing
        return 4
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição de altura do item
      #--------------------------------------------------------------------------
      def item_height
        36
      end
      #--------------------------------------------------------------------------
      # * Aquisição das informações do item
      #--------------------------------------------------------------------------
      def item
        @data && index >= 0 ? @data[index] : nil
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação de seleção
      #--------------------------------------------------------------------------
      def current_item_enabled?
        enable?(@data[index])
      end
      #--------------------------------------------------------------------------
      # * Inclusão do item na lista
      #     item : item
      #--------------------------------------------------------------------------
      def include?(item)
        case @category
        when :item
          item.is_a?(RPG::Item) && !item.key_item? #or item.is_a?(RPG::Weapon)
        when :key_item
          item.is_a?(RPG::Item) && item.key_item?
        else
          false
        end
      end
      #--------------------------------------------------------------------------
      # * Definição de itens disponíveis para uso
      #--------------------------------------------------------------------------
      def usable?(item)
        if item.is_a?(RPG::Weapon)
          return true
        else
          return $game_party.usable?(item)
        end
        return false
      
      end
      #--------------------------------------------------------------------------
      # * Definição de habilitação do item
      #     item : item
      #--------------------------------------------------------------------------
      def enable?(item)
        #$game_party.usable?(item)
        return true
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de itens
      #--------------------------------------------------------------------------
      def make_item_list
        @data = $game_party.all_items.select {|item| include?(item) }
        @data.push(nil) if include?(nil)
      end
      #--------------------------------------------------------------------------
      # * Retorno à seleção anterior
      #--------------------------------------------------------------------------
     
      def select_last
        select(@data.index($game_party.last_item.object) || 0)
      end
      #--------------------------------------------------------------------------
      # * desenhar o item
      #--------------------------------------------------------------------------
     
      def draw_item_name(item, x, y, enabled = true, width = 80)
        return unless item
        draw_icon(item.icon_index, x + 10, y + 6, enabled)
        change_color(normal_color, enabled)
    #~     draw_text(x + 5, y + 50, width, line_height, item.name)
      end
      #--------------------------------------------------------------------------
      # * Desenho de um item
      #     index : índice do item
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
      
        if item
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(item, rect.x , rect.y, true)
          rect.y -= 20
          draw_item_number(rect, item)
        end
      end
     
      #--------------------------------------------------------------------------
      # * Desenho do número de itens possuido
      #     rect : retângulo
      #     item : item
      #--------------------------------------------------------------------------
      def draw_item_number(rect, item)
        draw_text(rect, sprintf(" %2d", $game_party.item_number(item)), 2) #unless it has some tag in the notes??
      end
      #--------------------------------------------------------------------------
      # * Atualização da janela de ajuda  #<--- Thanks Theo Allen for help editing
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_item(item)
        @help_window.refresh
        return unless @iname_window
        @iname_window.set_item(item)
        @iname_window.refresh
      end
     
      #--------------------------------------------------------------------------
      # * Update Item Name #OTTO
      #--------------------------------------------------------------------------
    #~   def update_iname
    #~     @iname_window.set_item(item)
    #~     @iname_window.refresh
    #~   end
     
      #--------------------------------------------------------------------------
      # * Renovação
      #--------------------------------------------------------------------------
      def refresh
        make_item_list
        create_contents
        draw_all_items
        update_help
    #~     update_iname
      end
    
    end
     
    class Comand_itens < Window_Command
      #--------------------------------------------------------------------------
      # * Inicialização do objeto
      #--------------------------------------------------------------------------
      def initialize
        super(168, 120)
        refresh
      end
     
      #--------------------------------------------------------------------------
      # * Aquisição da largura da janela
      #--------------------------------------------------------------------------
      def window_width
        return 100
      end
      def window_height
        return 76
      end
      def activeCombine=(active)
        @activecombine = active
      end
      def usename=(name)
        @usename = name
      end
      def activeCombine
        return @activecombine
      end
      def usename
        return @usename
      end
      def important=(value)
        @important = value
      end
      def important
        return @important
      end
      def isuse=(value)
        @isuse = value
      end
      def isuse
        return @isuse
      end
      #--------------------------------------------------------------------------
      # * Criação da lista de comandos
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(usename,   :usar,   isuse)
        add_command(RE_MENU::Combine,  :combine,  activeCombine)
    #~     add_command(RE_MENU::Discard,  :discart,  important)
      end
    end
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Inicialização do processo
      #--------------------------------------------------------------------------
      def start
        super
        create_Help_window
        create_command_window
        create_item_window
        create_Iname_window
        create_status_window
        create_command_itens
        create_Equip_window
        create_Image_Background
        @iscombine = false
        @actor = $game_party.members[0]
      end
     
      #--------------------------------------------------------------------------
      # * Criação da janela de comando
      #--------------------------------------------------------------------------
      def create_command_window
        @command_window = MenuCommand.new
        @command_window.set_handler(:item,      method(:command_item))
        @command_window.set_handler(:key_item,      method(:command_item))
        @command_window.set_handler(:game_end,  method(:command_game_end))
        @command_window.set_handler(:cancel,    method(:return_scene))
      end
      
      #--------------------------------------------------------------------------
      # * Criação da janela de itens
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @command_window.y + @command_window.height + 100
        wh = Graphics.height - wy
        @item_window = Window_ItemList.new(344, wy, 200, wh)
        @item_window.help_window = @help_window
        @item_window.set_handler(:ok,     method(:on_item_ok))
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @command_window.item_window = @item_window
        @command_window.item_window = @item_window
      end
      #--------------------------------------------------------------------------
      # * Criação da janela de comando dos intems
      #--------------------------------------------------------------------------
      def create_command_itens
        @command_item = Comand_itens.new
        @command_item.set_handler(:usar,      method(:use_item))
        @command_item.set_handler(:combine,      method(:combine_item))
        @command_item.set_handler(:discart,  method(:discart_item))
        @command_item.set_handler(:cancel,    method(:return_itens))
        @command_item.visible = false
        @command_item.active = false
      end
     
      #--------------------------------------------------------------------------
      # * Criação das janelas #Position for Status and Equip #OTTO
      #--------------------------------------------------------------------------
      def create_status_window
        @Status_window = Window_Base.new(475,120,165,84)
        @Status_window.contents.clear
        #@Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.change_color(@Status_window.normal_color)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 0, 32, 120)
      end
     
      def create_Help_window
        @help_window = Window_Help.new() #RE_Window_Help.new()
      end
     
      def create_Iname_window #OTTO
        @ihelp_window = RE_Window_Iname.new()
        @item_window.iname_window = @ihelp_window
      end
     
      def create_Equip_window
        @Equip_window = Window_Base.new(475,204,165,48)
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
          #INSERT CURRENT / REMAINING AMMO HERE # OTTO
          #@Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
      
      
      end
      def use_item
        if @item.is_a?(RPG::Weapon)
          @actor.change_equip(0,@item)
          Sound.play_equip
        else
          Sound.play_use_item
          @actor.use_item(@item)
          use_item_to_actors
        
        end
        return_itens
        refresh
        check_common_event
      end
      def use_item_to_actors
        $game_party.members.each do |target|
          @item.repeats.times { target.item_apply(@actor, @item) }
        end
      end
      def check_common_event
        if $game_temp.common_event_reserved?
          SceneManager.goto(Scene_Map)
          @iscombine = false
        end
      end
      def combine_item
        if @iscombine == false
          @iscombine = true
          @combineitem = @item
        else
          recipe = RE_MENU::Recipe
          if @combineitem.id == @item.template_id
            if $game_party.item_number(@item) <= 1
              @combineitem = nil
            end
          end
          if @combineitem != nil
            for x in 1..recipe.size
            recipe1 = recipe[x]
          
              if recipe1[0] == @combineitem.template_id and recipe1[1] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              elsif recipe1[1] == @combineitem.template_id and recipe1[0] == @item.template_id
                @iscombine = false
                combineitens(x)
                break
              end
            end
          end
          if @iscombine == true
            Sound.play_buzzer
              @iscombine = false
          end
        
        end
        refresh
        return_itens
      
      
      end
      def combineitens(x)
        RE_MENU::playcombine
        $game_party.gain_item(@item, -1, true)
        $game_party.gain_item(@combineitem, -1, true)
        for y in 0..$data_items.size
            novoitem = $data_items[y] if y == RE_MENU::Recipe[x][2]
        end
        $game_party.gain_item(novoitem, 1)
      end
      def discart_item
        $game_party.gain_item(@item, -1, true)
        return_itens
      end
      def return_itens
        @command_item.visible = false
        @command_item.active = false
        @item_window.active = true
        @item_window.refresh
      end
      #--------------------------------------------------------------------------
      # * Item [Confirmação] #thanks to A-Moonless-Night
      #--------------------------------------------------------------------------
       #THIS BYPASSES THE SECOND USE/COMBINE WINDOW AND JUMPS DIRECTLY TO RECIPE CHECK
    def on_item_ok
        @item = @item_window.item
        if @item != nil
          if @iscombine && @item.is_a?(RPG::Item) && !@item.key_item?
            combine_item
          else
            if @item.is_a?(RPG::Weapon)
              @command_item.activeCombine = false
              @command_item.usename = RE_MENU::Equip
            else
              @command_item.activeCombine = true
              @command_item.usename = RE_MENU::Use
            end
            if @item.is_a?(RPG::Item) and @item.key_item?
              @command_item.important = false
            else
              @command_item.important = true
            end
            if @item_window.usable?(@item)
              @command_item.isuse = true
            else
              @command_item.isuse = false
            end
            @command_item.refresh
            @command_item.visible = true
            @command_item.active = true
          end
        else
          Sound.play_buzzer
          @item_window.active = true
        end
        @help_window.set_item(@item)
      end 
     
    #~   def on_item_ok
    #~     @item = @item_window.item
    #~     if @item != nil
    #~       if @item.is_a?(RPG::Weapon)
    #~         @command_item.activeCombine = false
    #~         @command_item.usename = RE_MENU::Equip
    #~       else
    #~         @command_item.activeCombine = true
    #~         @command_item.usename = RE_MENU::Use
    #~       end
    #~       if @item.is_a?(RPG::Item) and @item.key_item?
    #~         @command_item.important = false
    #~       else
    #~         @command_item.important = true
    #~       end
    #~       if @item_window.usable?(@item)
    #~         @command_item.isuse = true
    #~       else
    #~         @command_item.isuse = false
    #~       end
    #~     
    #~       @command_item.refresh
    #~       @command_item.visible = true
    #~       @command_item.active = true
    #~     else
    #~       Sound.play_buzzer
    #~       @item_window.active = true
    #~     end
    #~     @help_window.set_item(@item)
    #~   end
      #--------------------------------------------------------------------------
      # * Item [Cancelamento]
      #--------------------------------------------------------------------------
      def on_item_cancel
        @item_window.unselect
        @command_window.activate
        @iscombine = false
      end
     
      #--------------------------------------------------------------------------
      # * Comando [Item]
      #--------------------------------------------------------------------------
      def command_item
        @command_window.item_window = @item_window
        @item_window.activate
        @item_window.select_last
      
      end
      #--------------------------------------------------------------------------
      # Trying to add a Maps command #OTTO
      #--------------------------------------------------------------------------
      def command_maps
        SceneManager.call(Scene_Map)
      end
      #--------------------------------------------------------------------------
      # * Comando [Fim do Jogo]
      #--------------------------------------------------------------------------
      def command_game_end
        SceneManager.call(Scene_End)
      end
      #--------------------------------------------------------------------------
      # * Comandos individuais [Cancelamento]
      #--------------------------------------------------------------------------
      def on_personal_cancel
        @status_window.unselect
        @command_window.activate
      end
     
      def refresh
        @actor = $game_party.members[0]
        @item_window.refresh
        @Equip_window.contents.clear
        if @actor.equips[0] != nil
          @Equip_window.draw_icon(@actor.equips[0].icon_index, 36, 0, true)
          @Equip_window.draw_text(0, -12 , 120, 48, RE_MENU::Equip)
    #~       @Equip_window.draw_text(10, 40 , 150, 50, @actor.equips[0].name)
        end
        @Status_window.contents.clear
    #~     @Status_window.draw_actor_face(@actor, 1, 10)
        @Status_window.change_color(@Status_window.normal_color)
        @Status_window.draw_text(1, -15 , 120, 48, @actor.name)
        @Status_window.draw_actor_hp(@actor, 100, 40, 120)
        
      end
    end
     
    #18

Share This Page