Jump to content
Rpg²S Forum
  • 0

Cerco scripter per due piccoli "edit" (niente di impegnativo)


GhostRider
 Share

Question

Salve ragazzi, faccio questa richiesta non per me (che se avrò aperto vxa 10 volte in vita mia è dire tanto XD), ma per una mia amica (beh anche per me ok, visto che si tratta di una sorta di collaborazione, ma vabè sto divagando asdasdasd...);

 

Dovremmo inserire, in una sorta di gioco simil survival-horror (come i vecchi RE, SH, Alone in the Dark 4, etc...) un sistema di "combina oggetti" per unire due oggetti in uno (esempio banale: metà sinistra di un emblema + metà destra di un emblema = emblema intero); la mia collega ha trovato uno script su internet che funziona proprio come vuole lei, ma il problema è che apre un interfaccia nuova, che non ha molto senso considerando che di base usa il "single character menu" di un certo Dark Paladin.

 

 

http://s15.postimg.org/u98pbkdln/Capture.png

 

 

(con un bel po' di editing visivi per lo più) che ha solo le due liste di items e key items (gli unici che ci interessano), e vorremmo che l'opzione "combina" operi direttamente all'interno della lista "Items" senza aprire nuovi menù; abbiamo in oltre un sistema (sempre via script) di "item weight" che, oltre ovviamente a stabilire un limite di carico, ogni volta che si clicca su un oggetto ci viene data la scelta USA e SCARTA, ora siccome Scarta non serve, ho modificato io stesso (per quel poco che ne capisco) in modo da eliminare il comando scarta e aggiungere al suo posto il comando Combina. allo stato attuale delle cose, cliccando su combina viene semplicemente richiamata la Scene_Combine (così si chiama lo script, è una "scene" pensata per sostituire la Scene_Items normale), ma ovviamente l'effetto visivo lascia abbastanza a desiderare.

 

Ecco gli script "interessati":

 

Scene_Combine (questo NON l'ho toccato, è così di default):

 

 

=begin
===============================================================================
 Scene_Combine by efeberk
 Version: RGSS3
===============================================================================
 This script will allow to combine two items and generate a new item from
 combined items. The scene is similiar with item_window. Actually you can use
 Scene_Combine instead of Scene_Item because there is an option named "Use" that
 allows you to use items. Why you need Item scene?
 
 Example : You have 1 potion and 1 stimulant. Combine them and generate a new
 Ultra stimulant.
--------------------------------------------------------------------------------
 
How to open Scene_Combine:
 
SceneManager.call(Scene_Combine)
 
Note : This script works on Items, Weapons and Armors
=end
 
module EFE
  COMBINE_BUTTON = "Combine"
  USE_BUTTON = "Use"
  SUCCESS = "Items have been combined succesfully"
 
  #Item name will be colored when you select an item in the list.
  SELECTED_COLOR = 14
 
 
  COMBINATIONS = [
   
  #[[item1, :type], [item2, :type], [result, :type]],
  #[[item1, :type], [item2, :type], [result, :type]],
  [[1, :item],[2, :weapon], [3, :armor]],
  [[8, :item],[9, :item], [3, :armor]]
 
  ]
end
 
#==============================================================================
# ** Window_ItemKategory
#------------------------------------------------------------------------------
#  This window is for selecting a category of normal items and equipment
# on the item screen or shop screen.
#==============================================================================
 
class Window_ItemKategory < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :item_window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 4
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @item_window.category = current_symbol if @item_window
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::item,     :item)
    add_command(Vocab::weapon,   :weapon)
    add_command(Vocab::armor,    :armor)
    add_command(Vocab::key_item, :key_item)
  end
  #--------------------------------------------------------------------------
  # * Set Item Window
  #--------------------------------------------------------------------------
  def item_window=(item_window)
    @item_window = item_window
    update
  end
end
 
 
class Window_ItemListe < Window_Selectable
 
    attr_reader    :accepted_items
    attr_reader    :combining
 
  def initialize(x, y, width, height)
    super
    @combining = false
    @accepted_items = []
    @category = :none
    @data = []
  end
 
  def combining=(combine)
    @combining = combine
  end
 
  def category=(category)
    return if @category == category
    @category = category
    refresh
    self.oy = 0
  end
 
  def col_max
    return 2
  end
 
  def item_max
    @data ? @data.size : 1
  end
 
  def item
    @data && index >= 0 ? @data[index] : nil
  end
 
  def current_item_enabled?
    enable?(@data[index])
  end
 
  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
 
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y, enabled)
    draw_text(x + 24, y, width, line_height, item.name)
  end
 
  def enable?(item)
    return true if @combining
    $game_party.usable?(item)
  end
 
  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    @data.push(nil) if include?(nil)
  end
 
  def select_last
    select(@data.index($game_party.last_item.object) || 0)
  end
 
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      k = [item.id, :item] if item.is_a?(RPG::Item)
      k = [item.id, :weapon] if item.is_a?(RPG::Weapon)
      k = [item.id, :armor] if item.is_a?(RPG::Armor)
      change_color(normal_color, enable?(item))
      change_color(text_color(EFE::SELECTED_COLOR), enable?(item)) if @accepted_items.include?(k)
      draw_item_name(item, rect.x, rect.y, enable?(item))
      draw_item_number(rect, item)
    end
  end
 
  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end
 
  def update_help
    @help_window.set_item(item)
  end
 
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
end
 
 
class Window_AcceptCombination < Window_HorzCommand
 
  def initialize(x, y)
    super(x, y)
    self.z = 0
  end
 
  def window_width
    return Graphics.width
  end
 
  def col_max
    return 2
  end
 
  def make_command_list
    add_command(EFE::COMBINE_BUTTON,   :combine)
    add_command(EFE::USE_BUTTON, :use)
  end
end
 
class Scene_Combine < Scene_ItemBase
 
  def start
    super
    create_help_window
    create_options_window
    create_category_window
    create_item_window
  end
 
  def create_options_window
    @options_window = Window_AcceptCombination.new(0, @help_window.y + @help_window.height)
    @options_window.set_handler(:combine,     method(:combine_ok))
    @options_window.set_handler(:use,     method(:use_ok))
    @options_window.set_handler(:cancel,     method(:return_scene))
  end
 
  def combine_ok
    @item_window.combining = true
    @combine = true
    @category_window.item_window = @item_window
    @options_window.deactivate.unselect
    @category_window.activate.select(0)
  end
 
  def use_ok
    @item_window.combining = false
    @category_window.item_window = @item_window
    @options_window.deactivate.unselect
    @category_window.activate.select(0)
  end
 
  def create_category_window
    @category_window = Window_ItemKategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = @help_window.height + @options_window.height
    @category_window.set_handler(:ok,     method(:on_category_ok))
    @category_window.set_handler(:cancel, method(:on_category_cancel))
  end
 
  def create_item_window
    wy = @category_window.y + @category_window.height
    wh = Graphics.height - wy
    @item_window = Window_ItemListe.new(0, wy, Graphics.width, wh)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
    @category_window.deactivate.unselect
  end
 
  def on_category_ok
    @item_window.activate
    @item_window.select_last
  end
 
  def on_category_cancel
    @item_window.deactivate.unselect
    @item_window.accepted_items.clear
    @category_window.deactivate.unselect
    @options_window.activate.select(0)
  end
 
  def on_item_ok
    k = [@item_window.item.id, :item] if @item_window.item.is_a?(RPG::Item)
    k = [@item_window.item.id, :weapon] if @item_window.item.is_a?(RPG::Weapon)
    k = [@item_window.item.id, :armor] if @item_window.item.is_a?(RPG::Armor)
    if !@item_window.combining
      @options_window.deactivate
      $game_party.last_item.object = item
      determine_item
    else
      if @item_window.accepted_items.include?(k)
        @item_window.accepted_items.delete(k)
      else
        @item_window.accepted_items.push(k)
      end
      if @item_window.accepted_items.size == 2
        check_combinations(@item_window.accepted_items[0], @item_window.accepted_items[1])
        @item_window.refresh
      else
        @item_window.refresh
        @item_window.activate
      end
    end
  end
 
  def check_combinations(id1, id2)
    EFE::COMBINATIONS.each {|i|
    if (id1 == i[0] || id1 == i[1]) && (id2 == i[0] || id2 == i[1])
      @combineitem1 = $data_items[i[0][0]] if i[0][1] == :item
      @combineitem1 = $data_weapons[i[0][0]] if i[0][1] == :weapon
      @combineitem1 = $data_armors[i[0][0]] if i[0][1] == :armor
      @combineitem2 = $data_items[i[1][0]] if i[1][1] == :item
      @combineitem2 = $data_weapons[i[1][0]] if i[1][1] == :weapon
      @combineitem2 = $data_armors[i[1][0]] if i[1][1] == :armor
      @resultitem = $data_items[i[2][0]] if i[2][1] == :item
      @resultitem = $data_weapons[i[2][0]] if i[2][1] == :weapon
      @resultitem = $data_armors[i[2][0]] if i[2][1] == :armor
      @item_window.accepted_items.clear
      @item_window.refresh
      @item_window.activate
      $game_party.lose_item(@combineitem1, 1)
      $game_party.lose_item(@combineitem2, 1)
      $game_party.gain_item(@resultitem, 1)
      messagebox(EFE::SUCCESS, 400)
      return
    end
    }
    @item_window.accepted_items.clear
    @item_window.refresh
    @item_window.activate
  end
 
  def on_item_cancel
    @item_window.unselect
    @category_window.activate
  end
 
  def play_se_for_item
    Sound.play_use_item
  end
 
  def use_item
    super
    @item_window.redraw_current_item
  end
end

=begin
===============================================================================
 MessageBox by efeberk
 Version: RGSS3
===============================================================================
 This script will allow to open a new messagebox window only with a text.
--------------------------------------------------------------------------------

Call MessageBox in Script:

messagebox(text, width)

width : width of the window

=end

class Window_MessageBox < Window_Base

  def initialize(x, y, text, width)
    super(x, y, width, fitting_height(1))
    refresh(text)
  end
 
 
  def refresh(text)
    draw_text(0, 0, contents_width, line_height, text, 1)
  end

end

class Scene_MessageBox < Scene_Base
 
  def start
    super
    create_message_window
    create_background
  end
 
  def prepare(text, width)
    @text = text
    @width = width
  end
 
  def update
    super
    if Input.repeat?(:B) || Input.repeat?(:C)
      SceneManager.return
    end
  end
 
  def create_message_window
    @message_window = Window_MessageBox.new(0, 0, @text, @width)
    @message_window.width = @width
    @message_window.x = (Graphics.width / 2) - (@message_window.width / 2)
    @message_window.y = (Graphics.height / 2) - (@message_window.height / 2)
  end
 
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(100, 100, 100, 128)
  end
end

def messagebox(text, width)
    SceneManager.call(Scene_MessageBox)
    SceneManager.scene.prepare(text, width)
end

 

 

 

lo script per il peso con le mie piccole modifiche (un fallito tentativo di integrare il primo nel secondo, ma l'unica cosa che realmente sono riuscito a fare è stata togliere "scarta" e inserire "combina" asd:

 

 

 

#=======================================================
#         Lune Item Weight
# Author : Raizen
# Script Function:
# The scripts adds the function of items having weight on the game,
# Basically all item have weights and they can only be carried if below the limit
#=======================================================


module Lune_Weight
#=============================================================================#
#=========================   General Settings   ==============================#
#=============================================================================#

# To configure a weight for an item, go to Database,
# Inside the notetags after choosing an item or equipe, put the following.
# <weight n> where n is the weight value,
# Example an item weighting 60,
# <weight 60>

# In case there are no notetags on the Item, the script will
# choose a default value which is:

Default = 0

# Receive even if over weight?
# To prevent from the actor receiving important itens through the game,
# you can allow the player to receive itens even if they are over the
# weight limit.
Receive = false
# If false, you need to know how to event the important itens, putting
# conditions so that importat itens are not left out without being received.

# In case they are over the weight limit, you can lock the character movement.
Travar = false

# Below the variables that you can use to make the event conditions:

# Choose a variable to receive the value of amount of weight carried.
Var_C = 8
# Choose a variable to receive the value of amount of the weight limit.
Var_M = 9
# With both variables you can event the conditions of receiving items or even
# event conditions considering the weight carried and limit.

LimiteB = "" # Configure if you are using Lune Item Vault (My vault script)
# to have no limite, LimiteB = ""
#=============================================================================#
#=====================   Limit Weight Configuration   ========================#
#=============================================================================#

# Maximum amount of weight carried,
# to configure the weight limit, you can put a variable value, a constant value
# or strength value.
# To put the main actor strength value => :for1
# To put the sum of actors strength value => :all_for
# To be the main actor level => :lvl1
# To be the sum of all actors level => :all_lvl
# To be a variable => :var
# To be a constant => :fix


# Exemple Carry_Limit = lvl1 will make only the strength of the
# first actor to be put in the formula.
Carry_Limit = :var

# Now you need to configure the formula of the weight limit,
# Exemple, if I want to the limit be 2 times all the party members strength

# def self.weight_formula(at)
#   at * 2
# end

# at is the value of the atribute, and the multiply by 2 to get the total limit.

# In case its a variable or a constant number, just put the
# variable number, or the constant number.

# Exemple:

# def self.weight_formula(at)
#   20
# end

# The limit will be variable 20, ou if chosen a constant, will be 20.


def self.weight_formula(at)
  9
end

module EFE #edit by ghost
#~   COMBINE_BUTTON = "Combina" #edit by ghost - removed, no need for this
#~   USE_BUTTON = " " #edit by ghost - removed, no need for this
  SUCCESS = "Hai ottenuto un nuovo Oggetto." #edit by ghost
    #Item name will be colored when you select an item in the list.
  SELECTED_COLOR = 14
   
  COMBINATIONS = [
   
  #[[item1, :type], [item2, :type], [result, :type]],
  #[[item_id, :item], [item_id, :item], [item_id, :item]],
  [[12, :item],[13, :item], [14, :item]],
    
  ]
end

#===================== Vocabulary Settings ==========================#
# To Vocab, always put the text between commas '', or "".
# Weight name,
PS = ' lbs'

# Vocab on menu and shop
# Weight:
Peso = '• PESO:'

#Carrying =
Carregando = '• TOT:'

# If Lune Vault System included
# Vault =
Bau = '-unused ' #edit by ghost - removed, no need for this

# Vocabulary on item window

# Use =
Usar = 'Usa'
# Combine =
Combinar = 'Combina' #edit by ghost
# Dispose =
Descartar = 'Scarta' #remove


#=============================================================================#
#========================== Here starts the script ===========================#
#=============================================================================#

  #--------------------------------------------------------------------------
  # * Calculo do limite de peso
  #--------------------------------------------------------------------------
  def self.weight_limit
    return unless $game_party.members[0]
    case Carry_Limit
    when :for1
      weight = weight_formula($game_party.members[0].param(2))
    when :all_for
      weight = 0
      for members in 0...$game_party.members.size - 1
        weight += weight_formula($game_party.members[members].param(2))
      end
    when :lvl1
      weight = weight_formula($game_party.members[0].level)
    when :all_lvl
      weight = 0
      for members in 0...$game_party.members.size - 1
        weight += weight_formula($game_party.members[members].level)
      end
    when :fix
      weight = weight_formula(0)
    when :var
      weight = $game_variables[weight_formula(0)]
    end
    $game_variables[Var_M] = weight
    weight
  end
end



#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  Esta classe gerencia o grupo. Contém informações sobre dinheiro, itens.
# A instância desta classe é referenciada por $game_party.
#==============================================================================

class Game_Party < Game_Unit
alias :lune_weight_gain :gain_item
  #--------------------------------------------------------------------------
  # * Quantidade de itens carregados mais os itens equipados
  #--------------------------------------------------------------------------
  def carried_items
    @all_carried_items = 0
    all_items.each {|item| get_weight(item)}
    for i in 0...4
      members.each {|actor| @all_carried_items += calc_weight(actor.equips[i], 1)}
    end
    $game_variables[Lune_Weight::Var_C] = @all_carried_items
    @all_carried_items
  end
  #--------------------------------------------------------------------------
  # * Calculo do peso de um item no inventário
  #--------------------------------------------------------------------------
  def get_weight(item)
    if item.note =~ /<weight (.*)>/i
      @all_carried_items += $1.to_i * item_number(item)
    else
      @all_carried_items += Lune_Weight::Default * item_number(item)
    end
  end
  #--------------------------------------------------------------------------
  # * Calculo do peso de um item relativo a quantidade
  #--------------------------------------------------------------------------
  def calc_weight(item, amount)
    return 0 unless item
    if item.note =~ /<weight (.*)>/i
      carried_itens = $1.to_i * amount
    else
      carried_itens = Lune_Weight::Default * amount
    end
    carried_itens
  end
  #--------------------------------------------------------------------------
  # * Acrescentar item (redução)
  #     item          : item
  #     amount        : quantia alterada
  #     include_equip : incluir itens equipados
  #--------------------------------------------------------------------------
  def gain_item(item, amount, include_equip = false)
    if Lune_Weight::Receive
      lune_weight_gain(item, amount, include_equip = false)
      return
    end
    return if item == nil
    weight = calc_weight(item, amount) + carried_items
    while weight > Lune_Weight.weight_limit
      amount -= 1
      weight = calc_weight(item, amount) + carried_items
      return if amount == 0
    end
    lune_weight_gain(item, amount, include_equip = false)
  end
end

#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  Esta classe executa o processamento da tela de loja.
#==============================================================================

class Scene_Shop < Scene_MenuBase
alias :lune_max_buy :max_buy
  #--------------------------------------------------------------------------
  # * Aquisição do número máximo disponível para compra
  #--------------------------------------------------------------------------
  def max_buy
    max = lune_max_buy
    weight = $game_party.calc_weight(@item, max) + $game_party.carried_items
    while weight > Lune_Weight.weight_limit && max > 0
      max -= 1
      weight = $game_party.calc_weight(@item, max) + $game_party.carried_items
    end
    max
  end
  #--------------------------------------------------------------------------
  # * Criação da janela de ajuda.
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Weight_Help.new
    @help_window.viewport = @viewport
    @get_item_num = $game_party.carried_items
  end
  #--------------------------------------------------------------------------
  # * Atualização da janela de peso
  #--------------------------------------------------------------------------
  def update
    super
    if @get_item_num != $game_party.carried_items
      @help_window.refresh
      @get_item_num = $game_party.carried_items
    end
  end
end

#==============================================================================
# ** Window_ShopBuy
#------------------------------------------------------------------------------
#  Esta janela exibe bens compráveis na tela de loja.
#==============================================================================

class Window_ShopBuy < Window_Selectable
alias :lune_enable_item :enable?
  #--------------------------------------------------------------------------
  # * Definição de habilitação do item
  #     item : item
  #--------------------------------------------------------------------------
  def enable?(item)
    return false if $game_party.calc_weight(item, 1) + $game_party.carried_items > Lune_Weight.weight_limit
    lune_enable_item(item)
  end
end


#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  Esta janela exibe explicação de habilidades e itens e outras informações.
#==============================================================================

class Window_Weight_Help < Window_Base
include Lune_Weight
  #--------------------------------------------------------------------------
  # * Inicialização do objeto
  #     line_number : número de linhas
  #--------------------------------------------------------------------------
  def initialize(line_number = 2, bau = false)
    @bau = bau
    super(0, 0, Graphics.width, fitting_height(line_number))
    self.windowskin = Cache.system("Window-2")
  end
  #--------------------------------------------------------------------------
  # * Configuração de texto
  #     text : texto
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  def on_bau(bau = false)
    @bau = bau
  end
  #--------------------------------------------------------------------------
  # * Limpeza
  #--------------------------------------------------------------------------
  def clear
    set_text(" ")
  end
  #--------------------------------------------------------------------------
  # * Definição de item
  #     item : habilidades, itens, etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    @item = item
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Renovação
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
    if @item
      text = Peso + $game_party.calc_weight(@item,1).to_s + PS
      draw_text(515, 0, 200, line_height, text, 0)
#~       if @bau == true
#~         LimiteB == "" ? text_lim = "????" : text_lim = LimiteB
#~         text = Bau + $game_party.items_on_vault.to_s + "/" + text_lim.to_s + PS
#~       else
        text = Carregando + $game_party.carried_items.to_s + "/" + Lune_Weight.weight_limit.to_s + PS
      end
      draw_text(- 25, line_height, Graphics.width, line_height, text, 2)
    end
  end
#~ end


#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  Esta classe gerencia o jogador.
# A instância desta classe é referenciada por $game_player.
#==============================================================================

class Game_Player < Game_Character
alias :lune_move_by :move_by_input
  #--------------------------------------------------------------------------
  # * Processamento de movimento através de pressionar tecla
  #--------------------------------------------------------------------------
  def move_by_input
    return if Lune_Weight::Travar && $game_party.carried_items > Lune_Weight.weight_limit
    lune_move_by
  end
end


#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  Esta classe executa o processamento da tela de item.
#==============================================================================
class Scene_Item < Scene_ItemBase
alias raizen_combine_start start
  def start
    raizen_combine_start
    @combine_item = Window_Item_Combine.new
    @combine_item.viewport = @viewport
    @combine_item.set_handler(:use, method(:command_use))
#~     @combine_item.set_handler(:discard, method(:command_discard)) #no need
    @combine_item.set_handler(:combine, method(:command_combine)) #edit by ghost
  end
  def on_item_ok
    if item == nil
      @item_window.activate
      return
    end
    if @combine_item.close?
      @combine_item.open
      @combine_item.activate
    else
      determine_item    
    end
  end

  def update
    super
    if @number_window and @number_window.nitens == true
        @number_window.nitens = false
        @combine_item.close
        @item_window.refresh
        @help_window.refresh
        @item_window.activate
    end
    if Input.trigger?(:B) and !@combine_item.close?
      Sound.play_cancel
      if @number_window and !@number_window.close?
        @number_window.close
        @combine_item.activate
      else
        @combine_item.close
        @item_window.activate
      end
    end
  end
  def command_use
    determine_item
  end

#~   def command_discard
#~     if @number_window and !@number_window.close?
#~       @combine_item.activate
#~       return
#~     end
#~     @number_window = Window_NumberInputInner.new(Window_Base.new(0,0,0,0), item, @item_window.index)
#~     @number_window.viewport = @viewport
#~     @number_window.start
#~   end
  def create_help_window
    @help_window = Window_Weight_Help.new
    @help_window.viewport = @viewport
  end
end

  def command_combine  #edit by ghost
    SceneManager.call(Scene_Combine)# integrare la combinazione di oggetti # edit by ghost
  end  #edit by ghost
 
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  Esta janela exibe os parâmetros dos membros do grupo na tela de menu.
#==============================================================================

class Window_Item_Combine < Window_Command
include Lune_Weight
  #--------------------------------------------------------------------------
  # * Inicialização do objeto
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    self.z = 9999
    self.x = (Graphics.width / 2) - (window_width / 2)
    self.y = Graphics.height / 2
    self.openness = 0
  end
  #--------------------------------------------------------------------------
  # * Aquisição da largura da janela
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * Criação da lista de comandos
  #--------------------------------------------------------------------------
  def make_command_list
    add_main_commands

  end
  #--------------------------------------------------------------------------
  # * Adição dos comandos principais
  #--------------------------------------------------------------------------
  def add_main_commands
    add_command(Usar,   :use,   true)
    add_command(Combinar,  :combine,  true) #edit by ghost
#~     add_command(Descartar, :discard, true)
  end
end




#==============================================================================
# ** Scene_ItemBase
#------------------------------------------------------------------------------
#  Esta é a superclasse das classes que executam as telas de itens e
# habilidades.
#==============================================================================

class Scene_ItemBase < Scene_MenuBase
  def determine_item
    @combine_item.close
    if item.is_a?(RPG::Item) and item.for_friend?
      show_sub_window(@actor_window)
      @actor_window.select_for_item(item)
    else
      item.is_a?(RPG::Item) ? use_item : Sound.play_buzzer
      activate_item_window
    end
  end
end

#==============================================================================
# ** Window_NumberInputInner
#------------------------------------------------------------------------------
#  Esta janela é utilizada para o comando de eventos [Armazenar Número]
#==============================================================================

class Window_NumberInputInner < Window_NumberInput
attr_accessor :nitens
def initialize(message_window, item, index_2)
  @index_2 = index_2
  @item = item
  @get_lost_itens = 0
  super(message_window)
end
  #--------------------------------------------------------------------------
  # * Inicialização do processo
  #--------------------------------------------------------------------------
  def start
    @digits_max = 2
    @number = @get_lost_itens
    @number = [[@number, 0].max, 10 ** @digits_max - 1].min
    @index = 0
    update_placement
    create_contents
    refresh
    open
    activate
  end
  #--------------------------------------------------------------------------
  # * Atualização da posição da janela
  #--------------------------------------------------------------------------
  def update_placement
    self.width = @digits_max * 20 + padding * 2
    self.height = fitting_height(1)
    self.x = (Graphics.width - width) / 2
    self.y = Graphics.height/2 - height
    self.z = 150
  end

  #--------------------------------------------------------------------------
  # * Definição de resultado ao pressionar o botão de confirmação
  #--------------------------------------------------------------------------
  def process_ok
    Sound.play_ok
    number = $game_party.item_number(@item)
    if @number <= number
    make_icon
    end
    deactivate
    @nitens = true
    close
  end
  def make_icon
    @nitens = true
    $game_party.lose_item(@item, @number)
  end
end

#==============================================================================
# ** Window_ItemList
#------------------------------------------------------------------------------
#  Esta janela exibe a lista de itens possuidos na tela de itens.
#==============================================================================

class Window_ItemList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Definição de habilitação do item
  #     item : item
  #--------------------------------------------------------------------------
  def enable?(item)
    true
  end
end

$lune_weight_script = true

 

 

 

e se serve, il menu single di Dark Paladin:

 

 

 

###############################################################################
# Dark Paladin Single Character Menu v1.2
# Platform: VX Ace
# Author: Dark Paladin
# Description: A menu system for a single Character.
# Terms of use: You MAY use this script for your Non-commercial Projects.
# You MAY use this script for Commercial projects without my permission.
# Credit is appreciated but not needed.
# This script requires: N/A Cachext Included
###############################################################################
#==============================================================================
# CONFIG AREA
#==============================================================================

module DKP_Menu_Config
Enable_Background = true # true/false Use Background?
Menu_Background = "Menu" # Set the name of the background pic
# Place Image in "Graphics/DPmenu/Main/" Or change it in the cachext module.
Status_Opacity = 0 # Status Window Opacity
Help_Opacity = 0 # Item Help Window Opacity
Item_Opacity = 0 # Item Window Opacity
Command_Opacity = 0 # Command Window Opacity
CategoryW_Opacity = 0 # Category Window Opacity
end

module Cachext
#--------------------------------------------------------------------------
# DKP Cachext
# Do not edit unless you really know what your doing!
# Platform: VX Ace
# Author: Dark paladin
# Description: Module for menu background.
# -------------------------------------------------------------------------
#--------------------------------------------------------------------------
# *Graphics
#--------------------------------------------------------------------------
#You can edit the stuff in purple between the "" to change folder location.
#--------------------------------------------------------------------------
# *Menu Graphics Folder
#--------------------------------------------------------------------------
def self.dpmenu(filename)# You can change the Folder names here for background image.
load_bitmap("Graphics/DPmenu/Main/", filename)
end
#==============================================================================
# END CONFIG AREA
#==============================================================================
#--------------------------------------------------------------------------
# * Load Bitmap
#--------------------------------------------------------------------------
def self.load_bitmap(folder_name, filename, hue = 0)
@cachext ||= {}
if filename.empty?
empty_bitmap
elsif hue == 0
normal_bitmap(folder_name + filename)
else
hue_changed_bitmap(folder_name + filename, hue)
end
end
#--------------------------------------------------------------------------
# * Create Empty Bitmap
#--------------------------------------------------------------------------
def self.empty_bitmap
Bitmap.new(32, 32)
end
#--------------------------------------------------------------------------
# * Create/Get Normal Bitmap
#--------------------------------------------------------------------------
def self.normal_bitmap(path)
@cachext = Bitmap.new(path) unless include?(path)
@cachext
end
#--------------------------------------------------------------------------
# * Create/Get Hue-Changed Bitmap
#--------------------------------------------------------------------------
def self.hue_changed_bitmap(path, hue)
key =
unless include?(key)
@cachext = normal_bitmap(path).clone
@cachext.hue_change(hue)
end
@cachext
end
#--------------------------------------------------------------------------
# * Check Cache Existence
#--------------------------------------------------------------------------
def self.include?(key)
@cachext && !@cachext.disposed?
end
#--------------------------------------------------------------------------
# * Clear Cache
#--------------------------------------------------------------------------
def self.clear
@cachext ||= {}
@cachext.clear
GC.start
end
end

#==============================================================================
# ** Window_ItemCategory
#------------------------------------------------------------------------------
# This window is for selecting a category of normal items and equipment
# on the item screen or shop screen.
#==============================================================================
class Window_ItemCategory < Window_HorzCommand
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :item_window
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
244
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 2
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
@item_window.category = current_symbol if @item_window
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::item, :item)
add_command(Vocab::key_item, :key_item)
end
#--------------------------------------------------------------------------
# * Set Item Window
#--------------------------------------------------------------------------
def item_window=(item_window)
@item_window = item_window
update
end
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(0, 0, 640, 480)
@pending_index = -1
self.opacity = Status_Opacity
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 300
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
return 370
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
return 1
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
(height - standard_padding * 2) / 4
end
#--------------------------------------------------------------------------
# Simple Status
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 200)
draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(system_color)
draw_text(x, y, 0, line_height, Vocab::hp_a)
#~ draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
#~ hp_color(actor), normal_color)
end
def draw_actor_name(actor, x, y, width = 140)
change_color(hp_color(actor))
draw_text(x, y, width / 2, line_height, actor.name)
end
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, 461, 65) #188, 25
draw_actor_icons(actor, 0, y + line_height * 8)
draw_actor_hp(actor, 7, 60)
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
end
#--------------------------------------------------------------------------
# * Draw Background for Item
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# * Set Pending Position (for Formation)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end

#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================

class DKPWindow_Help < Window_Base
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(line_number = 4)
super(0, 0, 244, fitting_height(line_number))
self.opacity = Help_Opacity
end
#--------------------------------------------------------------------------
# * Set Text
#--------------------------------------------------------------------------
def set_text(text)
if text != @text
@text = text
refresh
end
end
#--------------------------------------------------------------------------
# * Clear
#--------------------------------------------------------------------------
def clear
set_text("")
end
#--------------------------------------------------------------------------
# * Set Item
# item : Skills and items etc.
#--------------------------------------------------------------------------
def set_item(item)
set_text(item ? item.description : "")
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text_ex(0, 0, word_wrapping(@text))
end
#--------------------------------------------------------------------------
# * Word Wrap
#--------------------------------------------------------------------------
def word_wrapping(text, pos = 0)
current_text_position = 0
for i in 0..(text.length - 1)
if text == "\n"
current_text_position = 0
next
end
current_text_position += contents.text_size(text).width
if (pos + current_text_position) >= (contents.width)
current_element = i
while(text != " ")
break if current_element == 0
current_element -= 1
end
temp_text = ""
for j in 0..(text.length - 1)
temp_text += text
temp_text += "\n" if j == current_element
end
text = temp_text
i = current_element
current_text_position = 0
end
end
return text
end
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays the party's gold.
#==============================================================================

class Window_Gold < Window_Base
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, fitting_height(1))
self.opacity = 0
self.z = 1000
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
end
#--------------------------------------------------------------------------
# * Get Party Gold
#--------------------------------------------------------------------------
def value
$game_party.gold
end
#~ #--------------------------------------------------------------------------
#~ # Get Currency Unit
#~ #--------------------------------------------------------------------------
def currency_unit
Vocab::currency_unit
end
#~ #--------------------------------------------------------------------------
#~ # * Open Window
#~ #--------------------------------------------------------------------------
def open
refresh
super
end
end
class Window_ItemList < Window_Selectable
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@category = :none
@data =
self.opacity = Item_Opacity
end
#--------------------------------------------------------------------------
# * Set Category
#--------------------------------------------------------------------------
def category=(category)
return if @category == category
@category = category
refresh
self.oy = 0
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
@data ? @data.size : 1
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
@data && index >= 0 ? @data : nil
end
#--------------------------------------------------------------------------
# * Get Activation State of Selection Item
#--------------------------------------------------------------------------
def current_item_enabled?
enable?(@data)
end
#--------------------------------------------------------------------------
# * Include in Item List?
#--------------------------------------------------------------------------
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && !item.key_item?
when :key_item
item.is_a?(RPG::Item) && item.key_item?
else
false
end
end
#--------------------------------------------------------------------------
# * Display in Enabled State?
#--------------------------------------------------------------------------
def enable?(item)
$game_party.usable?(item)
end
#--------------------------------------------------------------------------
# * Create Item List
#--------------------------------------------------------------------------
def make_item_list
@data = $game_party.all_items.select {|item| include?(item) }
@data.push(nil) if include?(nil)
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select(@data.index($game_party.last_item.object) || 0)
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
item = @data
if item
rect = item_rect(index)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enable?(item))
draw_item_number(rect, item)
end
end
#--------------------------------------------------------------------------
# * Draw Number of Items
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
@help_window.set_item(item)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
make_item_list
create_contents
draw_all_items
end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================

class Window_MenuCommand < Window_Command
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Initialize Command Selection Position (Class Method)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 3
end
#--------------------------------------------------------------------------
# * Get Spacing for Items Arranged Side by Side
#--------------------------------------------------------------------------
def spacing
return 100
end
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, Graphics.height- 47)
activate
select_last
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 640 #544
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
end
#--------------------------------------------------------------------------
# * Add Save to Command List
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# * Add Exit Game to Command List
#--------------------------------------------------------------------------
def add_game_end_command
add_command(Vocab::game_end, :game_end)
end
#--------------------------------------------------------------------------
# * Get Activation State of Main Commands
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# * Get Activation State of Save
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# * Processing When OK Button Is Pressed
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
end


class Game_Interpreter
def command_351
return if $game_party.in_battle
SceneManager.call(Scene_Item)
Window_MenuCommand::init_command_position
Fiber.yield
end
end
class Scene_Map < Scene_Base
def call_menu
SceneManager.call(Scene_Item)
Window_MenuCommand::init_command_position
end
end


#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs the item screen processing.
#==============================================================================

class Scene_Item < Scene_ItemBase
include DKP_Menu_Config
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_help_window
create_status_window
if Enable_Background != false then create_Image_Background end
#~ create_gold_window
create_command_window
create_category_window
create_item_window
#@category_window.deactivate
end
#--------------------------------------------------------------------------
# * Create Category Window
#--------------------------------------------------------------------------
def create_category_window
@category_window = Window_ItemCategory.new
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = 120
@category_window.opacity = CategoryW_Opacity
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_item))
end
#--------------------------------------------------------------------------
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_window
@item_window = Window_ItemList.new(0, 170, 244, 270)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@category_window.item_window = @item_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.opacity = Command_Opacity
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:game_end, method(:command_game_end))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# * Deactivate category
#--------------------------------------------------------------------------
def return_item
@category_window.deactivate
@command_window.activate
@command_window.select_last
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_item
@category_window.activate
@command_window.deactivate
end
#--------------------------------------------------------------------------
# * Create Gold Window
#--------------------------------------------------------------------------
#~ def create_gold_window
#~ @gold_window = Window_Gold.new
#~ @gold_window.x = Graphics.width - @gold_window.width
#~ @gold_window.y = Graphics.height - 100
#~ end
#--------------------------------------------------------------------------
# * Create Background Image
#--------------------------------------------------------------------------
def create_Image_Background
bitmap = Cachext.dpmenu(Menu_Background)
@background_sprite.bitmap = bitmap
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(244, 0)
end
#--------------------------------------------------------------------------
# * Create Help Window
#--------------------------------------------------------------------------
def create_help_window
@help_window = DKPWindow_Help.new
@help_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# * Category
#--------------------------------------------------------------------------
def on_category_ok
@item_window.activate
@item_window.select_last
end
#--------------------------------------------------------------------------
# * Item
#--------------------------------------------------------------------------
def on_item_ok
$game_party.last_item.object = item
determine_item
end
def determine_item
if item.for_friend?
show_sub_window(@actor_window)
@actor_window.select_for_item(item)
else
use_item
activate_item_window
end
end
def cursor_left?
@item_window.index % 1 == 0
end
def show_sub_window(window)
width_remain = Graphics.width - window.width
window.x = cursor_left? ? width_remain : 0
@viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
@viewport.rect.width = width_remain
window.show.activate
end
#--------------------------------------------------------------------------
# * Item
#--------------------------------------------------------------------------
def on_item_cancel
@item_window.unselect
@category_window.activate
end
#--------------------------------------------------------------------------
# * Play SE When Using Item
#--------------------------------------------------------------------------
def play_se_for_item
Sound.play_use_item
end
#--------------------------------------------------------------------------
# * Use Item
#--------------------------------------------------------------------------
def use_item
super
@item_window.redraw_current_item
end
end 

 

 

 

ricapitolando, mi servirebbe che la funziona per combinare gli oggetti "lavori" nello stesso menu in cui selezioniamo gli oggetti, piuttosto che aprirne uno nuovo;

 

il secondo edit, invece, più banale, se possibile mi servirebbe che anche avendo più copie di un oggetto (esempio 2 scatole di munizoni) il peso venga calcolato sempre come se si trattasse di uno solo.

 

e quest'è... penso che per uno scripter esperto sia roba di 30 secondi, per me è arabo, gia sono sorpreso di quel poco che ho fatto XDDDD

quindi nulla, ringrazio in anticipo chiunque vorrà darmi una mano, anche a nome della mia collega :)

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

scusate, nel terzo spoiler ho fatto un casino ho ricopiato un altro post pari pari XDDD non riesco ad editare :((

 

edit: asd nel primo post, bisognerebbe cancellare tutto quello che c'è nel terzo spoiler e aggiungerci questo:

 

 

 

[script inserito nel primo post. Per amor del forum e dei browser, lo levo da qui o c'è un 2x di script infinitamente lungo da caricare T_T

Ragazzi, non fate classi così ingestibili, fate laggare i browser!!]

By Flame

Edited by Flame

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

  • 0

se riesci a editare il secondo post, rifallo bene come dev'essere il primo e te lo sostituisco io

Membro Segreto della
Vecchia Guardia del Making [Gif in fase di reload]


SCContest1Oct.gif
gifnatale1.pnggifnatale12.png

Link to comment
Share on other sites

  • 0

Quello script per il peso è un pugno nell'occhio, ti consiglio di cambiarlo.

Inoltre, le serve davvero un item weight system o è solo un modo come un altro che ha scelto per limitare il numero di oggetti trasportabili?

Edited by BuddyTroller
Link to comment
Share on other sites

  • 0

beh inizialmente serviva proprio un item weight perchè il gioco doveva essere un survival-rpg-zombie-apocalypse-insommacisiamocapiti asd

ma il progetto è in fase di transizione e ora come ora, in effetti, è solo un modo per limitare l'inventario.

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

  • 0

Stabilizzare gli script base, prima di richiedere fine tuning. Uno script che non tocca il menu, permette di lavorare direttamente a una modifica del DKP Menu. NB: i termini me li invento.

Per esempio, TheoAllen Limited Inventory:

 

# =============================================================================
# TheoAllen - Limited Inventory
# Version : 1.4
# Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
# (English Documentation)
# =============================================================================
($imported ||= {})[:Theo_LimInventory] = true
# =============================================================================
# Change logs:
# -----------------------------------------------------------------------------
# 2015.02.02 - Added slowdown penalty when the inventory is full
#            - Added disable dash when the inventory is full
#            - Added force gain item to supports those newly added features
# 2014.09.22 - Bugfix. Negative number appear when use item and inventory 
#              reached its limit.
#            - Compatibility patch with YEA Menu Cursor
#            - Compatibility patch with MOG Menu Cursor as well
# 2014.02.25 - Add limited inventory eval formula to provide flexibility
#            - Change notetag constant to provide flexibility
# 2014.02.16 - Base Inventory slot of an actor can be changed using script call
# 2014.02.11 - Bugfix. Unequip item causes lose the item if inventory is full
# 2013.10.07 - Bugfix. Item doesn't removed when discarded
#            - Bugfix. Inventory amount not refreshed when item is discarded
# 2013.10.04 - Compatibility fix with chest system
# 2013.08.30 - Now unable to discard key item
# 2013.08.22 - Bugfix. Item size notetag isn't working
# 2013.08.19 - Bugfix when gained item
#            - Bugfix when disable display item size in shop menu
# 2013.08.18 - Finished script
# =============================================================================
=begin
  ---------------------------------------------------------------------------
  Introduction :
  This script allow you to limit your inventory by overall possesed items
  instead of individual items
  
  ---------------------------------------------------------------------------
  How to Use :
  Put this script below material but above main
  If you're using YEA - Shop Option, put it below that script
  Edit configurations and the notetags as described below
  
  ---------------------------------------------------------------------------
  Notetags :
  write down these notetags to the notebox in your database
  
  <inv size: n>
  Use this notetag where the n is a numeric value which is determine the size 
  of item. Use 0 for unlimited item. Only works for item and equipment such as 
  weapon or armor.
  
  <inv plus: n>
  Use this notetag to determine the additional avalaible free inventory slot.
  This notetag avalaible for Actor, Class, Equip, and States. If it's for 
  actor, avalaible inventory slot will increase when a new actor entered party. 
  If it's for equip, the avalaible slot will be increase if the certain equip 
  is equipped. And so do states.
  
  This value can be changed by script call during the game. Just check the
  script call instruction.
  
  <inv minus: n>
  Inverse of <inv plus>. It will decrease the avalaible inventory slot. Pretty
  clear I think.
  
  <inv formula>
  script
  </inv formula>
  This notetag is used to determine inventory limit based on your own formula
  For example, inventory limit for an actor is based on its agility or even
  its level. It can be used inside actor or class notebox.
  
  Inventory formula is automatically accumulated with base inventory. I mean,
  if you're going to add <inv plus: 100> and your formula. Then, the result is
  ==> 100 + your formula
  
  Example :
  <inv formula>
  level * 100
  </inv formula>
  By using this formula it means that each actor has leveled up, its base
  inventory will be increase by 100. If you're using multiple lines, it will be
  considered as a one line. You can also using these parameters to determine 
  your own formula.
  
  - mhp
  - mmp
  - atk
  - def
  - mat
  - mdf
  - agi
  - luk
  - $game_variables[id]
  
  Note :
  - A false formula may produce an error. So, make sure you write the correct 
    formula. Alternatively, you can ask ppl out there to help you out.
  - For scripter, the formula eval is evaled inside Game_Actor
  ---------------------------------------------------------------------------
  Script call :
  If you want to force gain an item even the inventory is full, you can do it
  by script call. Just write this following line
  
  force_gain_item($data_items[id],amount)
  id is an item id in your database
  
  To change base inventory for an actor, use these script call
  $game_actors[id].base_inv = value     << Set
  $game_actors[id].base_inv += value    << Add
  $game_actors[id].base_inv -= value    << Substract
  
  If you set dynamic slot as false, you can change inventory limit by using
  this script call.
  $game_party.base_inv = value
  
  ---------------------------------------------------------------------------
  Terms of use :
  Credit me, TheoAllen. You are free to edit this script by your own. As long
  as you don't claim it yours. For commercial purpose, don't forget to give me
  a free copy of the game.
=end
# =============================================================================
# Configurations :
# =============================================================================
module Theo
  module LimInv
  
  # --------------------------------------------------------------------------
  # General Settings (just put true / false)
  # --------------------------------------------------------------------------
  
    DynamicSlot       = true
  # Total avalaible inventory slot depends on actor, states, total party 
  # members, etc ...
  
    Display_ItemSize  = true
  # Diplay item size in item menu
  
    Include_Equip     = false
  # Total used inventory slot will also include actor equipment.
  
    DrawTotal_Size    = true
  # If true, item size window will show total weight of specified item. For 
  # example, you have 10 potions. And each potion has 3 size/weight. The window 
  # will show 30 instead of 3
  
    ForceGain         = true
  # Keep force to gain item when the item is full. Please set some penalties
  # when the inventory is full below to serve the purpose of this script
  # This overwrite the method gain item from default script. There is a chance 
  # of incompatibility between different script which also use the same method
    
    Full_DisableDash  = true
  # Disable dash when the inventory is full. Should be used when ForceGain
  # is set to true. If use together with YEA System Option, please put this
  # script below the YEA system option, unless you get rid completely the
  # autodash config in Yanfly's script
  
    Full_SlowDown     = true
  # Slowdown the player movement by 1 when the inventory is full Should be
  # used when ForceGain is set to true
  
  # --------------------------------------------------------------------------
  # Numeric Settings
  # --------------------------------------------------------------------------
  
    Default_FreeSlot  = 20
  # Default values which is provided each actor. Of course, you may change
  # it by notetag. If DynamicSlot is set to false, it will be used as the total
  # avalaible slot
  
    NearMaxed_Percent = 25
  # Remain avalaible slot percentage to determine if the inventory is almost 
  # maxed out or not.
  
    NearMaxed_Color   = 21
  # If inventory is almost maxed out, the inventory window will be drawn in
  # different color. The color code is same as \C[n] in message
  
    UseCommand_Size   = 200    
  # The width of use item command window
  
  # --------------------------------------------------------------------------
  # Vocab Settings (Self-explanatory I think)
  # --------------------------------------------------------------------------
  
    InvSlotVocab    = "Inventory: "   # Inventory Vocab
    InvSizeVocab    = "Item Size: "   # Item size / weight
    SlotVocabShort  = "Inv:"          # Abbreviation for Inventory
    UseVocab        = "Use item"      # Use item
    DiscardVocab    = "Discard item"  # Discard Item
    CancelVocab     = "Cancel"        # Cancel
    
  end
end
# ============================================================================
# Do not touch anything pass this line.
# ============================================================================
=begin
  -----------------------------------------------------------------------------
  Compatibility info :
  -----------------------------------------------------------------------------
  This script overwrite these methods :
  Game_Actor  >> trade_item_with_party
  Game_Party  >> max_item_number
  Game_Party  >> item_max?
  Game_Party  >> lose_item
  
  -----------------------------------------------------------------------------
  This script aliased these methods :
  DataManager >> load_database
  Game_Actor  >> setup
  Game_Party  >> initialize
  Scene_Menu  >> start
  Scene_Item  >> start
  Scene_Item  >> use_item
  Scene_Shop  >> on_buy_ok
  Scene_Shop  >> on_sell_ok
=end
# =============================================================================
# Altered built in modules and classes
# =============================================================================
# =============================================================================
# ▼ DataManager
# =============================================================================
class << DataManager
  
  alias theo_limited_item_load_db load_database
  def load_database
    theo_limited_item_load_db
    load_limited_slot
  end
  
  def load_limited_slot
    database = $data_actors + $data_classes + $data_weapons + $data_armors + 
      $data_states + $data_items
    database.compact.each do |db|
      db.load_limited_inv
    end
  end
end
# =============================================================================
# ▼ RPG::BaseItem
# =============================================================================
class RPG::BaseItem
  attr_accessor :inv_size # Item inventory size
  attr_accessor :inv_mod  # Inventory slot modifier
  attr_accessor :inv_eval # Inventory eval modifier
  
  InvSizeREGX     = /<inv[\s_]+size\s*:\s*(\d+)>/i
  InvPlusREGX     = /<inv[\s_]+plus\s*:\s*(\d+)>/i
  InvMinusREGX    = /<inv[\s_]+minus\s*:\s*(\d+)/i
  InvFormSTART    = /<inv[\s_]+formula>/i
  InvFormEND      = /<\/inv[\s_]+formula>/i
  
  def load_limited_inv
    load_eval = false
    @inv_size = 1
    @inv_eval = '0'
    @inv_mod = self.is_a?(RPG::Actor) ? Theo::LimInv::Default_FreeSlot : 0
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when InvSizeREGX
        @inv_size = $1.to_i
      when InvPlusREGX
        @inv_mod = $1.to_i
      when InvMinusREGX
        @inv_mod = -$1.to_i
      when InvFormSTART
        load_eval = true
        @inv_eval = ''
      when InvFormEND
        load_eval = false
      else
        @inv_eval += line if load_eval
      end
    end
  end
  
end
# =============================================================================
# Data structures and workflows goes here
# =============================================================================
# =============================================================================
# ▼ Game_Actor
# =============================================================================
class Game_Actor < Game_Battler
  attr_accessor :base_inv
  
  alias theo_liminv_setup setup
  def setup(actor_id)
    theo_liminv_setup(actor_id)
    @base_inv = $data_actors[id].inv_mod
  end
  
  def equip_size
    return 0 unless Theo::LimInv::Include_Equip
    equips.compact.inject(0) {|total,equip| total + equip.inv_size}
  end
  
  def inv_max
    result = base_inv
    result += $data_classes[class_id].inv_mod
    result += states.inject(0) {|total,db| total + db.inv_mod}
    result += equips.compact.inject(0) {|total,db| total + db.inv_mod}
    result += eval(actor.inv_eval)
    result += eval(self.class.inv_eval)
    result
  end
  # --------------------------------------------------------------------------
  # Overwrite : Trade item with party
  # --------------------------------------------------------------------------
  def trade_item_with_party(new_item, old_item)
    return false if new_item && !$game_party.has_item?(new_item)
    $game_party.force_gain_item(old_item, 1)
    $game_party.force_gain_item(new_item, -1)
    return true
  end
  
end
# =============================================================================
# ▼ Game_Party
# =============================================================================
class Game_Party < Game_Unit
  attr_accessor :base_inv
  
  alias theo_liminv_init initialize
  def initialize
    @base_inv = (Theo::LimInv::DynamicSlot ? 0 : Theo::LimInv::Default_FreeSlot)
    theo_liminv_init
  end
  
  def inv_max
    return @base_inv unless Theo::LimInv::DynamicSlot
    return members.inject(0) {|total,member| total + member.inv_max} + @base_inv
  end
  
  def inv_maxed?
    inv_max <= total_inv_size
  end
  
  def total_inv_size
    result = all_items.inject(0) {|total,item| total + 
      (item_number(item) * item.inv_size)}
    result += members.inject(0) {|total,member| total + member.equip_size}
    result
  end
  
  alias theo_liminv_max_item max_item_number
  def max_item_number(item)
    $BTEST ? theo_liminv_max_item(item) : inv_max_item(item) + item_number(item)
  end
  
  def inv_max_item(item)
    return 9999999 if item.nil? || item.inv_size == 0
    free_slot / item.inv_size
  end
  
  def free_slot
    inv_max - total_inv_size
  end
  
  alias theo_liminv_item_max? item_max?
  def item_max?(item)
    $BTEST ? theo_liminv_item_max?(item) : inv_maxed?
  end
  
  def near_maxed?
    free_slot.to_f / inv_max <= Theo::LimInv::NearMaxed_Percent/100.0
  end
  
  def item_size(item)
    return 0 unless item
    item.inv_size * item_number(item)
  end
  
  def force_gain_item(item, amount, include_equip = false)
    container = item_container(item.class)
    return unless container
    last_number = item_number(item)
    new_number = last_number + amount
    container[item.id] = [new_number, 0].max
    container.delete(item.id) if container[item.id] == 0
    if include_equip && new_number < 0
      discard_members_equip(item, -new_number)
    end
    $game_map.need_refresh = true
  end
  
  def lose_item(item, amount, include_equip = false)
    force_gain_item(item, -amount, include_equip)
  end
  
  alias theo_liminv_gain_item gain_item
  def gain_item(item, amount, include_equip = false)
    if Theo::LimInv::ForceGain
      force_gain_item(item, amount, include_equip)
    else
      theo_liminv_gain_item(item, amount, include_equip)
    end
  end
  
end
# =============================================================================
# ▼ Game_Player
# =============================================================================
class Game_Player
  
  alias theo_liminv_dash? dash?
  def dash?
    return false if Theo::LimInv::Full_DisableDash && $game_party.inv_maxed?
    return theo_liminv_dash?
  end
  
  alias theo_liminv_real_move_speed real_move_speed
  def real_move_speed
    theo_liminv_real_move_speed - move_penalty
  end
  
  def move_penalty
    Theo::LimInv::Full_SlowDown && $game_party.inv_maxed? ? 1 : 0
  end
  
end
# =============================================================================
# ▼ Game_Interpreter
# =============================================================================
class Game_Interpreter
  def force_gain_item(item, amount)
    $game_party.force_gain_item(item, amount)
  end
end
# =============================================================================
# Window related class goes here
# =============================================================================
# =============================================================================
# ▼ Window_Base
# =============================================================================
class Window_Base < Window
  def draw_inv_slot(x,y,width = contents.width,align = 2)
    txt = sprintf("%d/%d",$game_party.total_inv_size, $game_party.inv_max)
    color = Theo::LimInv::NearMaxed_Color
    if $game_party.near_maxed?
      change_color(text_color(color))
    else
      change_color(normal_color)
    end
    draw_text(x,y,width,line_height,txt,align)
    change_color(normal_color)
  end
  
  def draw_inv_info(x,y,width = contents.width)
    change_color(system_color)
    draw_text(x,y,width,line_height,Theo::LimInv::InvSlotVocab)
    change_color(normal_color)
    draw_inv_slot(x,y,width)
  end
  
  def draw_item_size(item,x,y,total = true,width = contents.width)
    rect = Rect.new(x,y,width,line_height)
    change_color(system_color)
    draw_text(rect,Theo::LimInv::InvSizeVocab)
    change_color(normal_color)
    number = (Theo::LimInv::DrawTotal_Size && total) ? 
      $game_party.item_size(item) : item.nil? ? 0 : item.inv_size
    draw_text(rect,number,2)
  end
end
# =============================================================================
# ▼ New Class : Window_MenuLimInv
# =============================================================================
class Window_MenuLimInv < Window_Base
  
  def initialize(width)
    super(0,0,width,fitting_height(1))
    refresh
  end
  
  def refresh
    contents.clear
    change_color(system_color)
    txt = Theo::LimInv::SlotVocabShort
    draw_text(0,0,contents.width,line_height,txt)
    draw_inv_slot(0,0)
  end
  
end
# =============================================================================
# ▼ New Class : Window_ItemSize
# =============================================================================
class Window_ItemSize < Window_Base
  
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
  end
  
  def set_item(item)
    @item = item
    refresh 
  end
  
  def refresh
    contents.clear
    draw_item_size(@item,0,0)
  end
  
end
# =============================================================================
# ▼ New Class : Window_FreeSlot
# =============================================================================
class Window_FreeSlot < Window_Base
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
    refresh
  end
  
  def refresh
    contents.clear
    draw_inv_info(0,0)
  end
end
# =============================================================================
# ▼ New Class : Window_ItemUseCommand
# =============================================================================
class Window_ItemUseCommand < Window_Command
  include Theo::LimInv
  
  def initialize
    super(0,0)
    self.openness = 0
  end
  
  def set_item(item)
    @item = item
    refresh
  end
  
  def window_width
    UseCommand_Size
  end
  
  def make_command_list
    add_command(UseVocab, :use, $game_party.usable?(@item))
    add_command(DiscardVocab, :discard, discardable?(@item))
    add_command(CancelVocab, :cancel)
  end
  
  def to_center
    self.x = Graphics.width/2 - width/2
    self.y = Graphics.height/2 - height/2
  end
  
  def discardable?(item)
    return false if item.nil?
    !(item.is_a?(RPG::Item) && item.itype_id == 2)
  end
  
end
# =============================================================================
# ▼ New Class : Window_DiscardAmount
# =============================================================================
class Window_DiscardAmount < Window_Base
  attr_accessor :cmn_window
  attr_accessor :itemlist
  attr_accessor :freeslot
  
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
    self.openness = 0
    @amount = 0
  end
  
  def set_item(item)
    @item = item
    @amount = 0
    refresh
  end
  
  def refresh
    contents.clear
    return unless @item
    draw_item_name(@item,0,0,true,contents.width)
    txt = sprintf("%d/%d",@amount, $game_party.item_number(@item))
    draw_text(0,0,contents.width,line_height,txt,2)
  end
  
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y, enabled)
    change_color(normal_color, enabled)
    draw_text(x + 24, y, width, line_height, item.name + ":")
  end
  
  def update
    super
    return unless open?
    change_amount(1) if Input.repeat?(:RIGHT)
    change_amount(-1) if Input.repeat?(:LEFT)
    change_amount(10) if Input.repeat?(:UP)
    change_amount(-10) if Input.repeat?(:DOWN)
    lose_item if Input.trigger?(:C)
    close_window if Input.trigger?(:B)
  end
  
  def change_amount(num)
    @amount = [[@amount+num,0].max,$game_party.item_number(@item)].min
    Sound.play_cursor
    refresh
  end
  
  def lose_item
    $game_party.lose_item(@item,@amount)
    @itemlist.redraw_current_item
    @freeslot.refresh
    if $game_party.item_number(@item) == 0
      Sound.play_ok
      @itemlist.activate.refresh
      @cmn_window.close.deactivate
      close
    else
      close_window
    end
  end
  
  def close_window
    close
    @cmn_window.activate
    Sound.play_ok
  end
  
end
# =============================================================================
# ▼ Window_ItemList
# =============================================================================
class Window_ItemList < Window_Selectable
  attr_reader :item_size_window
  
  def item_size_window=(window)
    @item_size_window = window
    update_help
  end
  
  alias theo_liminv_update_help update_help
  def update_help
    theo_liminv_update_help
    @item_size_window.set_item(item) if @item_size_window
  end
  
  alias theo_liminv_height= height=
  def height=(height)
    self.theo_liminv_height = height
    refresh
  end
  
  def enable?(item)
    return !item.nil?
  end
  
end
# =============================================================================
# ▼ Window_ShopNumber
# =============================================================================
class Window_ShopNumber < Window_Selectable
  attr_accessor :mode
  
  alias theo_liminv_init initialize
  def initialize(x, y, height)
    theo_liminv_init(x, y, height)
    @mode = :buy
  end
  
  alias theo_liminv_refresh refresh
  def refresh
    theo_liminv_refresh
    draw_itemsize
  end
  
  def draw_itemsize
    item_size = @number * @item.inv_size
    total_size = $game_party.total_inv_size + 
      (@mode == :buy ? item_size : -item_size)
    txt = sprintf("%d/%d",total_size,$game_party.inv_max)
    ypos = item_y + line_height * ($imported["YEA-ShopOptions"] ? 5 : 4)
    rect = Rect.new(4,ypos,contents.width-8,line_height)
    change_color(system_color)
    draw_text(rect,Theo::LimInv::InvSlotVocab)
    change_color(normal_color)
    draw_text(rect,txt,2)
  end
  
end
# =============================================================================
# ▼ Window_ShopStatus
# =============================================================================
class Window_ShopStatus < Window_Base
  
  if Theo::LimInv::Display_ItemSize
  alias theo_liminv_draw_posses draw_possession
  def draw_possession(x, y)
    theo_liminv_draw_posses(x,y)
    y += line_height
    draw_item_size(@item,x,y,false, contents.width-(x*2))
  end
  
  if $imported["YEA-ShopOptions"]
  def draw_actor_equip_info(dx, dy, actor)
    dy += line_height
    enabled = actor.equippable?(@item)
    change_color(normal_color, enabled)
    draw_text(dx, dy, contents.width, line_height, actor.name)
    item1 = current_equipped_item(actor, @item.etype_id)
    draw_actor_param_change(dx, dy, actor, item1) if enabled
  end
  end # $imported["YEA-ShopOption"]
  end # Display item size

end
# =============================================================================
# Scene classes goes here
# =============================================================================
# =============================================================================
# ▼ Scene_Menu
# =============================================================================
class Scene_Menu < Scene_MenuBase
  
  alias theo_liminv_start start
  def start
    theo_liminv_start
    create_liminv_window
  end
  
  def create_liminv_window
    @lim_inv = Window_MenuLimInv.new(@gold_window.width)
    @lim_inv.x = @command_window.x
    @lim_inv.y = @command_window.height
  end
  
end
# =============================================================================
# ▼ Scene_Item
# =============================================================================
class Scene_Item < Scene_ItemBase
  
  alias theo_liminv_start start
  def start
    theo_liminv_start
    resize_item_window
    create_freeslot_window
    create_itemsize_window
    create_usecommand_window
    create_discard_amount
  end
  
  def resize_item_window
    @item_window.height -= @item_window.line_height * 2
  end
  
  def create_freeslot_window
    wy = @item_window.y + @item_window.height
    wh = Theo::LimInv::Display_ItemSize ? Graphics.width/2 : Graphics.width
    @freeslot = Window_FreeSlot.new(0,wy,wh)
    @freeslot.viewport = @viewport
  end
  
  def create_itemsize_window
    return unless Theo::LimInv::Display_ItemSize
    wx = @freeslot.width
    wy = @freeslot.y
    ww = wx
    @itemsize = Window_ItemSize.new(wx,wy,ww)
    @itemsize.viewport = @viewport
    @item_window.item_size_window = @itemsize
  end
  
  def create_usecommand_window
    @use_command = Window_ItemUseCommand.new
    @use_command.to_center
    @use_command.set_handler(:use, method(:use_command_ok))
    @use_command.set_handler(:discard, method(:on_discard_ok))
    @use_command.set_handler(:cancel, method(:on_usecmd_cancel))
    @use_command.viewport = @viewport
  end
  
  def create_discard_amount
    wx = @use_command.x
    wy = @use_command.y + @use_command.height
    ww = @use_command.width
    @discard_window = Window_DiscardAmount.new(wx,wy,ww)
    @discard_window.cmn_window = @use_command
    @discard_window.itemlist = @item_window
    @discard_window.freeslot = @freeslot
    @discard_window.viewport = @viewport
  end
  
  alias theo_liminv_item_ok on_item_ok
  def on_item_ok
    @use_command.set_item(item)
    @use_command.open
    @use_command.activate
    @use_command.select(0)
  end
  
  alias theo_liminv_use_item use_item
  def use_item
    @use_command.close
    theo_liminv_use_item
    @freeslot.refresh
  end
  
  def use_command_ok
    theo_liminv_item_ok
    @use_command.close
  end
  
  def on_discard_ok
    @discard_window.set_item(item)
    @discard_window.open
  end
  
  def on_usecmd_cancel
    @item_window.activate
    @use_command.close
    @use_command.deactivate
  end
  
end
# =============================================================================
# ▼ Scene_Shop
# =============================================================================
class Scene_Shop < Scene_MenuBase
  alias theo_liminv_buy_ok on_buy_ok
  def on_buy_ok
    @number_window.mode = :buy
    theo_liminv_buy_ok
  end
  
  alias theo_liminv_sell_ok on_sell_ok
  def on_sell_ok
    @number_window.mode = :sell
    theo_liminv_sell_ok
  end
end

# =============================================================================
# ▼ Compatibility patch thingy
# =============================================================================

if $imported["YEA-MenuCursor"]
class Sprite_MenuCursor
  def opacity_rate
    rate = 16
    return -rate if !@window.active || @window.close?
    return rate
  end
end
end

if $imported[:mog_menu_cursor]
module CURSOR_MENU_SPRITE
  def can_update_cursor_position?
    return false if !self.active     
    return false if self.index < 0 
    return false if !self.visible
    return false if self.close?
    return true
  end
end
end

 

 

Edited by BuddyTroller
Link to comment
Share on other sites

  • 0

Dax, il DKP Menu:

 

###############################################################################
# Dark Paladin Single Character Menu v1.2
#     Platform: VX Ace
#       Author: Dark Paladin
#  Description: A menu system for a single Character.
# Terms of use: You MAY use this script for your Non-commercial Projects.
#    You MAY use this script for Commercial projects without my permission.
#    Credit is appreciated but not needed.
# This script requires: N/A Cachext Included
###############################################################################
#==============================================================================  
# CONFIG AREA  
#==============================================================================
 
module DKP_Menu_Config
    Enable_Background = true           # true/false Use Background?
      Menu_Background = "Background2"  # Set the name of the background pic
                                       # Place Image in "Graphics/DPmenu/Main/" Or change it in the cachext module.
       Status_Opacity = 0              # Status Window Opacity
         Help_Opacity = 0              # Item Help Window Opacity
         Item_Opacity = 0              # Item Window Opacity
      Command_Opacity = 0              # Command Window Opacity
    CategoryW_Opacity = 0              # Category Window Opacity
  end
 
  module Cachext
  #--------------------------------------------------------------------------
  # DKP Cachext
  # Do not edit unless you really know what your doing!
  # Platform: VX Ace
  # Author: Dark paladin
  # Description: Module for menu background.
  # -------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # *Graphics
  #--------------------------------------------------------------------------  
  #You can edit the stuff in purple between the "" to change folder location.  
  #--------------------------------------------------------------------------
  # *Menu Graphics Folder
  #--------------------------------------------------------------------------
  def self.dpmenu(filename)# You can change the Folder names here for background image.
    load_bitmap("Graphics/DPmenu/Main/", filename)
  end
#==============================================================================  
# END CONFIG AREA  
#==============================================================================  
  #--------------------------------------------------------------------------
  # * Load Bitmap
  #--------------------------------------------------------------------------
  def self.load_bitmap(folder_name, filename, hue = 0)
    @cachext ||= {}
    if filename.empty?
      empty_bitmap
    elsif hue == 0
      normal_bitmap(folder_name + filename)
    else
      hue_changed_bitmap(folder_name + filename, hue)
    end
  end
  #--------------------------------------------------------------------------
  # * Create Empty Bitmap
  #--------------------------------------------------------------------------
  def self.empty_bitmap
    Bitmap.new(32, 32)
  end
  #--------------------------------------------------------------------------
  # * Create/Get Normal Bitmap
  #--------------------------------------------------------------------------
  def self.normal_bitmap(path)
    @cachext[path] = Bitmap.new(path) unless include?(path)
    @cachext[path]
  end
  #--------------------------------------------------------------------------
  # * Create/Get Hue-Changed Bitmap
  #--------------------------------------------------------------------------
  def self.hue_changed_bitmap(path, hue)
    key = [path, hue]
    unless include?(key)
      @cachext[key] = normal_bitmap(path).clone
      @cachext[key].hue_change(hue)
    end
    @cachext[key]
  end
  #--------------------------------------------------------------------------
  # * Check Cache Existence
  #--------------------------------------------------------------------------
  def self.include?(key)
    @cachext[key] && !@cachext[key].disposed?
  end
  #--------------------------------------------------------------------------
  # * Clear Cache
  #--------------------------------------------------------------------------
  def self.clear
    @cachext ||= {}
    @cachext.clear
    GC.start
  end
end
 
#==============================================================================
# ** Window_ItemCategory
#------------------------------------------------------------------------------
#  This window is for selecting a category of normal items and equipment
# on the item screen or shop screen.
#==============================================================================
class Window_ItemCategory < Window_HorzCommand
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :item_window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    244
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 2
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @item_window.category = current_symbol if @item_window
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::item,     :item)
    add_command(Vocab::key_item, :key_item)
  end
  #--------------------------------------------------------------------------
  # * Set Item Window
  #--------------------------------------------------------------------------
  def item_window=(item_window)
    @item_window = item_window
    update
  end
end
 
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================
 
class Window_MenuStatus < Window_Selectable
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :pending_index            # Pending position (for formation)
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, window_width, window_height)
    @pending_index = -1
    self.opacity = Status_Opacity
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 300
  end
  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  def window_height
    return 370
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items
  #--------------------------------------------------------------------------
  def item_max
   return 1
  end
  #--------------------------------------------------------------------------
  # * Get Item Height
  #--------------------------------------------------------------------------
  def item_height
    (height - standard_padding * 2) / 4
  end
  #--------------------------------------------------------------------------
  # Simple Status
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 200)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
    hp_color(actor), normal_color)
  end  
  def draw_actor_name(actor, x, y, width = 112)
    change_color(hp_color(actor))
    draw_text(x, y, width / 2, line_height, actor.name)
  end
    def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, 187, 25)
    draw_actor_icons(actor, 0, y + line_height * 8)
    draw_actor_hp(actor, 40, 100 + line_height * 1)
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    actor = $game_party.members[0]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
    draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
    draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Background for Item
  #--------------------------------------------------------------------------
  def draw_item_background(index)
    if index == @pending_index
      contents.fill_rect(item_rect(index), pending_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Processing When OK Button Is Pressed
  #--------------------------------------------------------------------------
  def process_ok
    super
    $game_party.menu_actor = $game_party.members[index]
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    select($game_party.menu_actor.index || 0)
  end
  #--------------------------------------------------------------------------
  # * Set Pending Position (for Formation)
  #--------------------------------------------------------------------------
  def pending_index=(index)
    last_pending_index = @pending_index
    @pending_index = index
    redraw_item(@pending_index)
    redraw_item(last_pending_index)
  end
end
 
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  This window shows skill and item explanations along with actor status.
#==============================================================================
 
class DKPWindow_Help < Window_Base
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(line_number = 4)
    super(0, 0, 244, fitting_height(line_number))
    self.opacity = Help_Opacity
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(0, 0, word_wrapping(@text))
  end
  #--------------------------------------------------------------------------
  # * Word Wrap
  #--------------------------------------------------------------------------
  def word_wrapping(text, pos = 0)
    current_text_position = 0    
    for i in 0..(text.length - 1)
      if text[i] == "\n"
        current_text_position = 0
        next
      end
      current_text_position += contents.text_size(text[i]).width
      if (pos + current_text_position) >= (contents.width)
        current_element = i
        while(text[current_element] != " ")
          break if current_element == 0
          current_element -= 1
        end
        temp_text = ""
        for j in 0..(text.length - 1)
          temp_text += text[j]
          temp_text += "\n" if j == current_element
        end
        text = temp_text
        i = current_element
        current_text_position = 0
      end
    end
    return text
  end
end
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays the party's gold.
#==============================================================================
 
class Window_Gold < Window_Base
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(1))
    self.opacity = 0
    self.z = 1000
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
  end
  #--------------------------------------------------------------------------
  # * Get Party Gold
  #--------------------------------------------------------------------------
  def value
    $game_party.gold
  end
  #--------------------------------------------------------------------------
  # Get Currency Unit
  #--------------------------------------------------------------------------
  def currency_unit
    Vocab::currency_unit
  end
  #--------------------------------------------------------------------------
  # * Open Window
  #--------------------------------------------------------------------------
  def open
    refresh
    super
  end
end
class Window_ItemList < Window_Selectable
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    @category = :none
    @data = []
    self.opacity = Item_Opacity
  end
  #--------------------------------------------------------------------------
  # * Set Category
  #--------------------------------------------------------------------------
  def category=(category)
    return if @category == category
    @category = category
    refresh
    self.oy = 0
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items
  #--------------------------------------------------------------------------
  def item_max
    @data ? @data.size : 1
  end
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    @data && index >= 0 ? @data[index] : nil
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Selection Item
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
  end
  #--------------------------------------------------------------------------
  # * Include in Item List?
  #--------------------------------------------------------------------------
  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
  #--------------------------------------------------------------------------
  # * Display in Enabled State?
  #--------------------------------------------------------------------------
  def enable?(item)
    $game_party.usable?(item)
  end
  #--------------------------------------------------------------------------
  # * Create Item List
  #--------------------------------------------------------------------------
  def make_item_list
    @data = $game_party.all_items.select {|item| include?(item) }
    @data.push(nil) if include?(nil)
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    select(@data.index($game_party.last_item.object) || 0)
  end
  #--------------------------------------------------------------------------
  # * Draw 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, enable?(item))
      draw_item_number(rect, item)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Number of Items
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================
 
class Window_MenuCommand < Window_Command
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Initialize Command Selection Position (Class Method)
  #--------------------------------------------------------------------------
  def self.init_command_position
    @@last_command_symbol = nil
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 3
  end
  #--------------------------------------------------------------------------
  # * Get Spacing for Items Arranged Side by Side
  #--------------------------------------------------------------------------
  def spacing
    return 100
  end
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, Graphics.height- 47)
    activate
    select_last
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 544
  end
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number
    return 1
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_main_commands
    add_save_command
    add_game_end_command
  end
  #--------------------------------------------------------------------------
  # * Add Main Commands to List
  #--------------------------------------------------------------------------
  def add_main_commands
    add_command(Vocab::item,   :item,   main_commands_enabled)
  end
  #--------------------------------------------------------------------------
  # * Add Save to Command List
  #--------------------------------------------------------------------------
  def add_save_command
    add_command(Vocab::save, :save, save_enabled)
  end
  #--------------------------------------------------------------------------
  # * Add Exit Game to Command List
  #--------------------------------------------------------------------------
  def add_game_end_command
    add_command(Vocab::game_end, :game_end)
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Main Commands
  #--------------------------------------------------------------------------
  def main_commands_enabled
    $game_party.exists
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Save
  #--------------------------------------------------------------------------
  def save_enabled
    !$game_system.save_disabled
  end
  #--------------------------------------------------------------------------
  # * Processing When OK Button Is Pressed
  #--------------------------------------------------------------------------
  def process_ok
    @@last_command_symbol = current_symbol
    super
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    select_symbol(@@last_command_symbol)
  end
end
 
 
class Game_Interpreter
  def command_351
    return if $game_party.in_battle
    SceneManager.call(Scene_Item)
    Window_MenuCommand::init_command_position
    Fiber.yield
  end
end
class Scene_Map < Scene_Base
  def call_menu
    SceneManager.call(Scene_Item)
    Window_MenuCommand::init_command_position
  end
end
 
 
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs the item screen processing.
#==============================================================================
 
class Scene_Item < Scene_ItemBase
  include DKP_Menu_Config
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_status_window
    if Enable_Background != false then create_Image_Background end
    create_gold_window
    create_command_window
    create_category_window
    create_item_window
    #@category_window.deactivate
  end
  #--------------------------------------------------------------------------
  # * Create Category Window
  #--------------------------------------------------------------------------
  def create_category_window
    @category_window = Window_ItemCategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = 120
    @category_window.opacity = CategoryW_Opacity
    @category_window.set_handler(:ok,     method(:on_category_ok))
    @category_window.set_handler(:cancel, method(:return_item))
  end
  #--------------------------------------------------------------------------
  # * Create Item Window
  #--------------------------------------------------------------------------
  def create_item_window
    @item_window = Window_ItemList.new(0, 170, 244, 200)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
    @category_window.item_window = @item_window
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_MenuCommand.new
    @command_window.opacity = Command_Opacity
    @command_window.set_handler(:item,      method(:command_item))
    @command_window.set_handler(:save,      method(:command_save))
    @command_window.set_handler(:game_end,  method(:command_game_end))
    @command_window.set_handler(:cancel,    method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Deactivate category
  #--------------------------------------------------------------------------
  def return_item
    @category_window.deactivate
    @command_window.activate
    @command_window.select_last
  end
  #--------------------------------------------------------------------------
  # * [Save] Command
  #--------------------------------------------------------------------------
  def command_save
    SceneManager.call(Scene_Save)
  end
  #--------------------------------------------------------------------------
  # * [Exit Game] Command
  #--------------------------------------------------------------------------
  def command_game_end
    SceneManager.call(Scene_End)
  end
  #--------------------------------------------------------------------------
  # * [Item] Command
  #--------------------------------------------------------------------------
  def command_item
    @category_window.activate
    @command_window.deactivate
  end
  #--------------------------------------------------------------------------
  # * Create Gold Window
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.x = Graphics.width - @gold_window.width
    @gold_window.y = Graphics.height - 100
  end
  #--------------------------------------------------------------------------
  # * Create Background Image
  #--------------------------------------------------------------------------
  def create_Image_Background
    bitmap = Cachext.dpmenu(Menu_Background)
    @background_sprite.bitmap = bitmap
  end
  #--------------------------------------------------------------------------
  # * Create Status Window
  #--------------------------------------------------------------------------
  def create_status_window
    @status_window = Window_MenuStatus.new(244, 0)
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = DKPWindow_Help.new
    @help_window.viewport = @viewport
  end  
  #--------------------------------------------------------------------------
  # * Category [OK]
  #--------------------------------------------------------------------------
  def on_category_ok
    @item_window.activate
    @item_window.select_last
  end
  #--------------------------------------------------------------------------
  # * Item [OK]
  #--------------------------------------------------------------------------
  def on_item_ok
    $game_party.last_item.object = item
    determine_item
  end
    def determine_item
    if item.for_friend?
      show_sub_window(@actor_window)
      @actor_window.select_for_item(item)
    else
      use_item
      activate_item_window
    end
  end
    def cursor_left?
    @item_window.index % 1 == 0
  end
    def show_sub_window(window)
    width_remain = Graphics.width - window.width
    window.x = cursor_left? ? width_remain : 0
    @viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
    @viewport.rect.width = width_remain
    window.show.activate
  end
  #--------------------------------------------------------------------------
  # * Item [Cancel]
  #--------------------------------------------------------------------------
  def on_item_cancel
    @item_window.unselect
    @category_window.activate
  end
  #--------------------------------------------------------------------------
  # * Play SE When Using Item
  #--------------------------------------------------------------------------
  def play_se_for_item
    Sound.play_use_item
  end
  #--------------------------------------------------------------------------
  # * Use Item
  #--------------------------------------------------------------------------
  def use_item
    super
    @item_window.redraw_current_item
  end
end 

 

 

Link to comment
Share on other sites

  • 0

Stabilizzare gli script base, prima di richiedere fine tuning. Uno script che non tocca il menu, permette di lavorare direttamente a una modifica del DKP Menu. NB: i termini me li invento.

 

Per esempio, TheoAllen Limited Inventory:

 

 

# =============================================================================
# TheoAllen - Limited Inventory
# Version : 1.4
# Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
# (English Documentation)
# =============================================================================
($imported ||= {})[:Theo_LimInventory] = true
# =============================================================================
# Change logs:
# -----------------------------------------------------------------------------
# 2015.02.02 - Added slowdown penalty when the inventory is full
#            - Added disable dash when the inventory is full
#            - Added force gain item to supports those newly added features
# 2014.09.22 - Bugfix. Negative number appear when use item and inventory 
#              reached its limit.
#            - Compatibility patch with YEA Menu Cursor
#            - Compatibility patch with MOG Menu Cursor as well
# 2014.02.25 - Add limited inventory eval formula to provide flexibility
#            - Change notetag constant to provide flexibility
# 2014.02.16 - Base Inventory slot of an actor can be changed using script call
# 2014.02.11 - Bugfix. Unequip item causes lose the item if inventory is full
# 2013.10.07 - Bugfix. Item doesn't removed when discarded
#            - Bugfix. Inventory amount not refreshed when item is discarded
# 2013.10.04 - Compatibility fix with chest system
# 2013.08.30 - Now unable to discard key item
# 2013.08.22 - Bugfix. Item size notetag isn't working
# 2013.08.19 - Bugfix when gained item
#            - Bugfix when disable display item size in shop menu
# 2013.08.18 - Finished script
# =============================================================================
=begin
  ---------------------------------------------------------------------------
  Introduction :
  This script allow you to limit your inventory by overall possesed items
  instead of individual items
  
  ---------------------------------------------------------------------------
  How to Use :
  Put this script below material but above main
  If you're using YEA - Shop Option, put it below that script
  Edit configurations and the notetags as described below
  
  ---------------------------------------------------------------------------
  Notetags :
  write down these notetags to the notebox in your database
  
  <inv size: n>
  Use this notetag where the n is a numeric value which is determine the size 
  of item. Use 0 for unlimited item. Only works for item and equipment such as 
  weapon or armor.
  
  <inv plus: n>
  Use this notetag to determine the additional avalaible free inventory slot.
  This notetag avalaible for Actor, Class, Equip, and States. If it's for 
  actor, avalaible inventory slot will increase when a new actor entered party. 
  If it's for equip, the avalaible slot will be increase if the certain equip 
  is equipped. And so do states.
  
  This value can be changed by script call during the game. Just check the
  script call instruction.
  
  <inv minus: n>
  Inverse of <inv plus>. It will decrease the avalaible inventory slot. Pretty
  clear I think.
  
  <inv formula>
  script
  </inv formula>
  This notetag is used to determine inventory limit based on your own formula
  For example, inventory limit for an actor is based on its agility or even
  its level. It can be used inside actor or class notebox.
  
  Inventory formula is automatically accumulated with base inventory. I mean,
  if you're going to add <inv plus: 100> and your formula. Then, the result is
  ==> 100 + your formula
  
  Example :
  <inv formula>
  level * 100
  </inv formula>
  By using this formula it means that each actor has leveled up, its base
  inventory will be increase by 100. If you're using multiple lines, it will be
  considered as a one line. You can also using these parameters to determine 
  your own formula.
  
  - mhp
  - mmp
  - atk
  - def
  - mat
  - mdf
  - agi
  - luk
  - $game_variables[id]
  
  Note :
  - A false formula may produce an error. So, make sure you write the correct 
    formula. Alternatively, you can ask ppl out there to help you out.
  - For scripter, the formula eval is evaled inside Game_Actor
  ---------------------------------------------------------------------------
  Script call :
  If you want to force gain an item even the inventory is full, you can do it
  by script call. Just write this following line
  
  force_gain_item($data_items[id],amount)
  id is an item id in your database
  
  To change base inventory for an actor, use these script call
  $game_actors[id].base_inv = value     << Set
  $game_actors[id].base_inv += value    << Add
  $game_actors[id].base_inv -= value    << Substract
  
  If you set dynamic slot as false, you can change inventory limit by using
  this script call.
  $game_party.base_inv = value
  
  ---------------------------------------------------------------------------
  Terms of use :
  Credit me, TheoAllen. You are free to edit this script by your own. As long
  as you don't claim it yours. For commercial purpose, don't forget to give me
  a free copy of the game.
=end
# =============================================================================
# Configurations :
# =============================================================================
module Theo
  module LimInv
  
  # --------------------------------------------------------------------------
  # General Settings (just put true / false)
  # --------------------------------------------------------------------------
  
    DynamicSlot       = true
  # Total avalaible inventory slot depends on actor, states, total party 
  # members, etc ...
  
    Display_ItemSize  = true
  # Diplay item size in item menu
  
    Include_Equip     = false
  # Total used inventory slot will also include actor equipment.
  
    DrawTotal_Size    = true
  # If true, item size window will show total weight of specified item. For 
  # example, you have 10 potions. And each potion has 3 size/weight. The window 
  # will show 30 instead of 3
  
    ForceGain         = true
  # Keep force to gain item when the item is full. Please set some penalties
  # when the inventory is full below to serve the purpose of this script
  # This overwrite the method gain item from default script. There is a chance 
  # of incompatibility between different script which also use the same method
    
    Full_DisableDash  = true
  # Disable dash when the inventory is full. Should be used when ForceGain
  # is set to true. If use together with YEA System Option, please put this
  # script below the YEA system option, unless you get rid completely the
  # autodash config in Yanfly's script
  
    Full_SlowDown     = true
  # Slowdown the player movement by 1 when the inventory is full Should be
  # used when ForceGain is set to true
  
  # --------------------------------------------------------------------------
  # Numeric Settings
  # --------------------------------------------------------------------------
  
    Default_FreeSlot  = 20
  # Default values which is provided each actor. Of course, you may change
  # it by notetag. If DynamicSlot is set to false, it will be used as the total
  # avalaible slot
  
    NearMaxed_Percent = 25
  # Remain avalaible slot percentage to determine if the inventory is almost 
  # maxed out or not.
  
    NearMaxed_Color   = 21
  # If inventory is almost maxed out, the inventory window will be drawn in
  # different color. The color code is same as \C[n] in message
  
    UseCommand_Size   = 200    
  # The width of use item command window
  
  # --------------------------------------------------------------------------
  # Vocab Settings (Self-explanatory I think)
  # --------------------------------------------------------------------------
  
    InvSlotVocab    = "Inventory: "   # Inventory Vocab
    InvSizeVocab    = "Item Size: "   # Item size / weight
    SlotVocabShort  = "Inv:"          # Abbreviation for Inventory
    UseVocab        = "Use item"      # Use item
    DiscardVocab    = "Discard item"  # Discard Item
    CancelVocab     = "Cancel"        # Cancel
    
  end
end
# ============================================================================
# Do not touch anything pass this line.
# ============================================================================
=begin
  -----------------------------------------------------------------------------
  Compatibility info :
  -----------------------------------------------------------------------------
  This script overwrite these methods :
  Game_Actor  >> trade_item_with_party
  Game_Party  >> max_item_number
  Game_Party  >> item_max?
  Game_Party  >> lose_item
  
  -----------------------------------------------------------------------------
  This script aliased these methods :
  DataManager >> load_database
  Game_Actor  >> setup
  Game_Party  >> initialize
  Scene_Menu  >> start
  Scene_Item  >> start
  Scene_Item  >> use_item
  Scene_Shop  >> on_buy_ok
  Scene_Shop  >> on_sell_ok
=end
# =============================================================================
# Altered built in modules and classes
# =============================================================================
# =============================================================================
# ▼ DataManager
# =============================================================================
class << DataManager
  
  alias theo_limited_item_load_db load_database
  def load_database
    theo_limited_item_load_db
    load_limited_slot
  end
  
  def load_limited_slot
    database = $data_actors + $data_classes + $data_weapons + $data_armors + 
      $data_states + $data_items
    database.compact.each do |db|
      db.load_limited_inv
    end
  end
end
# =============================================================================
# ▼ RPG::BaseItem
# =============================================================================
class RPG::BaseItem
  attr_accessor :inv_size # Item inventory size
  attr_accessor :inv_mod  # Inventory slot modifier
  attr_accessor :inv_eval # Inventory eval modifier
  
  InvSizeREGX     = /<inv[\s_]+size\s*:\s*(\d+)>/i
  InvPlusREGX     = /<inv[\s_]+plus\s*:\s*(\d+)>/i
  InvMinusREGX    = /<inv[\s_]+minus\s*:\s*(\d+)/i
  InvFormSTART    = /<inv[\s_]+formula>/i
  InvFormEND      = /<\/inv[\s_]+formula>/i
  
  def load_limited_inv
    load_eval = false
    @inv_size = 1
    @inv_eval = '0'
    @inv_mod = self.is_a?(RPG::Actor) ? Theo::LimInv::Default_FreeSlot : 0
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when InvSizeREGX
        @inv_size = $1.to_i
      when InvPlusREGX
        @inv_mod = $1.to_i
      when InvMinusREGX
        @inv_mod = -$1.to_i
      when InvFormSTART
        load_eval = true
        @inv_eval = ''
      when InvFormEND
        load_eval = false
      else
        @inv_eval += line if load_eval
      end
    end
  end
  
end
# =============================================================================
# Data structures and workflows goes here
# =============================================================================
# =============================================================================
# ▼ Game_Actor
# =============================================================================
class Game_Actor < Game_Battler
  attr_accessor :base_inv
  
  alias theo_liminv_setup setup
  def setup(actor_id)
    theo_liminv_setup(actor_id)
    @base_inv = $data_actors[id].inv_mod
  end
  
  def equip_size
    return 0 unless Theo::LimInv::Include_Equip
    equips.compact.inject(0) {|total,equip| total + equip.inv_size}
  end
  
  def inv_max
    result = base_inv
    result += $data_classes[class_id].inv_mod
    result += states.inject(0) {|total,db| total + db.inv_mod}
    result += equips.compact.inject(0) {|total,db| total + db.inv_mod}
    result += eval(actor.inv_eval)
    result += eval(self.class.inv_eval)
    result
  end
  # --------------------------------------------------------------------------
  # Overwrite : Trade item with party
  # --------------------------------------------------------------------------
  def trade_item_with_party(new_item, old_item)
    return false if new_item && !$game_party.has_item?(new_item)
    $game_party.force_gain_item(old_item, 1)
    $game_party.force_gain_item(new_item, -1)
    return true
  end
  
end
# =============================================================================
# ▼ Game_Party
# =============================================================================
class Game_Party < Game_Unit
  attr_accessor :base_inv
  
  alias theo_liminv_init initialize
  def initialize
    @base_inv = (Theo::LimInv::DynamicSlot ? 0 : Theo::LimInv::Default_FreeSlot)
    theo_liminv_init
  end
  
  def inv_max
    return @base_inv unless Theo::LimInv::DynamicSlot
    return members.inject(0) {|total,member| total + member.inv_max} + @base_inv
  end
  
  def inv_maxed?
    inv_max <= total_inv_size
  end
  
  def total_inv_size
    result = all_items.inject(0) {|total,item| total + 
      (item_number(item) * item.inv_size)}
    result += members.inject(0) {|total,member| total + member.equip_size}
    result
  end
  
  alias theo_liminv_max_item max_item_number
  def max_item_number(item)
    $BTEST ? theo_liminv_max_item(item) : inv_max_item(item) + item_number(item)
  end
  
  def inv_max_item(item)
    return 9999999 if item.nil? || item.inv_size == 0
    free_slot / item.inv_size
  end
  
  def free_slot
    inv_max - total_inv_size
  end
  
  alias theo_liminv_item_max? item_max?
  def item_max?(item)
    $BTEST ? theo_liminv_item_max?(item) : inv_maxed?
  end
  
  def near_maxed?
    free_slot.to_f / inv_max <= Theo::LimInv::NearMaxed_Percent/100.0
  end
  
  def item_size(item)
    return 0 unless item
    item.inv_size * item_number(item)
  end
  
  def force_gain_item(item, amount, include_equip = false)
    container = item_container(item.class)
    return unless container
    last_number = item_number(item)
    new_number = last_number + amount
    container[item.id] = [new_number, 0].max
    container.delete(item.id) if container[item.id] == 0
    if include_equip && new_number < 0
      discard_members_equip(item, -new_number)
    end
    $game_map.need_refresh = true
  end
  
  def lose_item(item, amount, include_equip = false)
    force_gain_item(item, -amount, include_equip)
  end
  
  alias theo_liminv_gain_item gain_item
  def gain_item(item, amount, include_equip = false)
    if Theo::LimInv::ForceGain
      force_gain_item(item, amount, include_equip)
    else
      theo_liminv_gain_item(item, amount, include_equip)
    end
  end
  
end
# =============================================================================
# ▼ Game_Player
# =============================================================================
class Game_Player
  
  alias theo_liminv_dash? dash?
  def dash?
    return false if Theo::LimInv::Full_DisableDash && $game_party.inv_maxed?
    return theo_liminv_dash?
  end
  
  alias theo_liminv_real_move_speed real_move_speed
  def real_move_speed
    theo_liminv_real_move_speed - move_penalty
  end
  
  def move_penalty
    Theo::LimInv::Full_SlowDown && $game_party.inv_maxed? ? 1 : 0
  end
  
end
# =============================================================================
# ▼ Game_Interpreter
# =============================================================================
class Game_Interpreter
  def force_gain_item(item, amount)
    $game_party.force_gain_item(item, amount)
  end
end
# =============================================================================
# Window related class goes here
# =============================================================================
# =============================================================================
# ▼ Window_Base
# =============================================================================
class Window_Base < Window
  def draw_inv_slot(x,y,width = contents.width,align = 2)
    txt = sprintf("%d/%d",$game_party.total_inv_size, $game_party.inv_max)
    color = Theo::LimInv::NearMaxed_Color
    if $game_party.near_maxed?
      change_color(text_color(color))
    else
      change_color(normal_color)
    end
    draw_text(x,y,width,line_height,txt,align)
    change_color(normal_color)
  end
  
  def draw_inv_info(x,y,width = contents.width)
    change_color(system_color)
    draw_text(x,y,width,line_height,Theo::LimInv::InvSlotVocab)
    change_color(normal_color)
    draw_inv_slot(x,y,width)
  end
  
  def draw_item_size(item,x,y,total = true,width = contents.width)
    rect = Rect.new(x,y,width,line_height)
    change_color(system_color)
    draw_text(rect,Theo::LimInv::InvSizeVocab)
    change_color(normal_color)
    number = (Theo::LimInv::DrawTotal_Size && total) ? 
      $game_party.item_size(item) : item.nil? ? 0 : item.inv_size
    draw_text(rect,number,2)
  end
end
# =============================================================================
# ▼ New Class : Window_MenuLimInv
# =============================================================================
class Window_MenuLimInv < Window_Base
  
  def initialize(width)
    super(0,0,width,fitting_height(1))
    refresh
  end
  
  def refresh
    contents.clear
    change_color(system_color)
    txt = Theo::LimInv::SlotVocabShort
    draw_text(0,0,contents.width,line_height,txt)
    draw_inv_slot(0,0)
  end
  
end
# =============================================================================
# ▼ New Class : Window_ItemSize
# =============================================================================
class Window_ItemSize < Window_Base
  
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
  end
  
  def set_item(item)
    @item = item
    refresh 
  end
  
  def refresh
    contents.clear
    draw_item_size(@item,0,0)
  end
  
end
# =============================================================================
# ▼ New Class : Window_FreeSlot
# =============================================================================
class Window_FreeSlot < Window_Base
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
    refresh
  end
  
  def refresh
    contents.clear
    draw_inv_info(0,0)
  end
end
# =============================================================================
# ▼ New Class : Window_ItemUseCommand
# =============================================================================
class Window_ItemUseCommand < Window_Command
  include Theo::LimInv
  
  def initialize
    super(0,0)
    self.openness = 0
  end
  
  def set_item(item)
    @item = item
    refresh
  end
  
  def window_width
    UseCommand_Size
  end
  
  def make_command_list
    add_command(UseVocab, :use, $game_party.usable?(@item))
    add_command(DiscardVocab, :discard, discardable?(@item))
    add_command(CancelVocab, :cancel)
  end
  
  def to_center
    self.x = Graphics.width/2 - width/2
    self.y = Graphics.height/2 - height/2
  end
  
  def discardable?(item)
    return false if item.nil?
    !(item.is_a?(RPG::Item) && item.itype_id == 2)
  end
  
end
# =============================================================================
# ▼ New Class : Window_DiscardAmount
# =============================================================================
class Window_DiscardAmount < Window_Base
  attr_accessor :cmn_window
  attr_accessor :itemlist
  attr_accessor :freeslot
  
  def initialize(x,y,width)
    super(x,y,width,fitting_height(1))
    self.openness = 0
    @amount = 0
  end
  
  def set_item(item)
    @item = item
    @amount = 0
    refresh
  end
  
  def refresh
    contents.clear
    return unless @item
    draw_item_name(@item,0,0,true,contents.width)
    txt = sprintf("%d/%d",@amount, $game_party.item_number(@item))
    draw_text(0,0,contents.width,line_height,txt,2)
  end
  
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y, enabled)
    change_color(normal_color, enabled)
    draw_text(x + 24, y, width, line_height, item.name + ":")
  end
  
  def update
    super
    return unless open?
    change_amount(1) if Input.repeat?(:RIGHT)
    change_amount(-1) if Input.repeat?(:LEFT)
    change_amount(10) if Input.repeat?(:UP)
    change_amount(-10) if Input.repeat?(:DOWN)
    lose_item if Input.trigger?(:C)
    close_window if Input.trigger?(:B)
  end
  
  def change_amount(num)
    @amount = [[@amount+num,0].max,$game_party.item_number(@item)].min
    Sound.play_cursor
    refresh
  end
  
  def lose_item
    $game_party.lose_item(@item,@amount)
    @itemlist.redraw_current_item
    @freeslot.refresh
    if $game_party.item_number(@item) == 0
      Sound.play_ok
      @itemlist.activate.refresh
      @cmn_window.close.deactivate
      close
    else
      close_window
    end
  end
  
  def close_window
    close
    @cmn_window.activate
    Sound.play_ok
  end
  
end
# =============================================================================
# ▼ Window_ItemList
# =============================================================================
class Window_ItemList < Window_Selectable
  attr_reader :item_size_window
  
  def item_size_window=(window)
    @item_size_window = window
    update_help
  end
  
  alias theo_liminv_update_help update_help
  def update_help
    theo_liminv_update_help
    @item_size_window.set_item(item) if @item_size_window
  end
  
  alias theo_liminv_height= height=
  def height=(height)
    self.theo_liminv_height = height
    refresh
  end
  
  def enable?(item)
    return !item.nil?
  end
  
end
# =============================================================================
# ▼ Window_ShopNumber
# =============================================================================
class Window_ShopNumber < Window_Selectable
  attr_accessor :mode
  
  alias theo_liminv_init initialize
  def initialize(x, y, height)
    theo_liminv_init(x, y, height)
    @mode = :buy
  end
  
  alias theo_liminv_refresh refresh
  def refresh
    theo_liminv_refresh
    draw_itemsize
  end
  
  def draw_itemsize
    item_size = @number * @item.inv_size
    total_size = $game_party.total_inv_size + 
      (@mode == :buy ? item_size : -item_size)
    txt = sprintf("%d/%d",total_size,$game_party.inv_max)
    ypos = item_y + line_height * ($imported["YEA-ShopOptions"] ? 5 : 4)
    rect = Rect.new(4,ypos,contents.width-8,line_height)
    change_color(system_color)
    draw_text(rect,Theo::LimInv::InvSlotVocab)
    change_color(normal_color)
    draw_text(rect,txt,2)
  end
  
end
# =============================================================================
# ▼ Window_ShopStatus
# =============================================================================
class Window_ShopStatus < Window_Base
  
  if Theo::LimInv::Display_ItemSize
  alias theo_liminv_draw_posses draw_possession
  def draw_possession(x, y)
    theo_liminv_draw_posses(x,y)
    y += line_height
    draw_item_size(@item,x,y,false, contents.width-(x*2))
  end
  
  if $imported["YEA-ShopOptions"]
  def draw_actor_equip_info(dx, dy, actor)
    dy += line_height
    enabled = actor.equippable?(@item)
    change_color(normal_color, enabled)
    draw_text(dx, dy, contents.width, line_height, actor.name)
    item1 = current_equipped_item(actor, @item.etype_id)
    draw_actor_param_change(dx, dy, actor, item1) if enabled
  end
  end # $imported["YEA-ShopOption"]
  end # Display item size

end
# =============================================================================
# Scene classes goes here
# =============================================================================
# =============================================================================
# ▼ Scene_Menu
# =============================================================================
class Scene_Menu < Scene_MenuBase
  
  alias theo_liminv_start start
  def start
    theo_liminv_start
    create_liminv_window
  end
  
  def create_liminv_window
    @lim_inv = Window_MenuLimInv.new(@gold_window.width)
    @lim_inv.x = @command_window.x
    @lim_inv.y = @command_window.height
  end
  
end
# =============================================================================
# ▼ Scene_Item
# =============================================================================
class Scene_Item < Scene_ItemBase
  
  alias theo_liminv_start start
  def start
    theo_liminv_start
    resize_item_window
    create_freeslot_window
    create_itemsize_window
    create_usecommand_window
    create_discard_amount
  end
  
  def resize_item_window
    @item_window.height -= @item_window.line_height * 2
  end
  
  def create_freeslot_window
    wy = @item_window.y + @item_window.height
    wh = Theo::LimInv::Display_ItemSize ? Graphics.width/2 : Graphics.width
    @freeslot = Window_FreeSlot.new(0,wy,wh)
    @freeslot.viewport = @viewport
  end
  
  def create_itemsize_window
    return unless Theo::LimInv::Display_ItemSize
    wx = @freeslot.width
    wy = @freeslot.y
    ww = wx
    @itemsize = Window_ItemSize.new(wx,wy,ww)
    @itemsize.viewport = @viewport
    @item_window.item_size_window = @itemsize
  end
  
  def create_usecommand_window
    @use_command = Window_ItemUseCommand.new
    @use_command.to_center
    @use_command.set_handler(:use, method(:use_command_ok))
    @use_command.set_handler(:discard, method(:on_discard_ok))
    @use_command.set_handler(:cancel, method(:on_usecmd_cancel))
    @use_command.viewport = @viewport
  end
  
  def create_discard_amount
    wx = @use_command.x
    wy = @use_command.y + @use_command.height
    ww = @use_command.width
    @discard_window = Window_DiscardAmount.new(wx,wy,ww)
    @discard_window.cmn_window = @use_command
    @discard_window.itemlist = @item_window
    @discard_window.freeslot = @freeslot
    @discard_window.viewport = @viewport
  end
  
  alias theo_liminv_item_ok on_item_ok
  def on_item_ok
    @use_command.set_item(item)
    @use_command.open
    @use_command.activate
    @use_command.select(0)
  end
  
  alias theo_liminv_use_item use_item
  def use_item
    @use_command.close
    theo_liminv_use_item
    @freeslot.refresh
  end
  
  def use_command_ok
    theo_liminv_item_ok
    @use_command.close
  end
  
  def on_discard_ok
    @discard_window.set_item(item)
    @discard_window.open
  end
  
  def on_usecmd_cancel
    @item_window.activate
    @use_command.close
    @use_command.deactivate
  end
  
end
# =============================================================================
# ▼ Scene_Shop
# =============================================================================
class Scene_Shop < Scene_MenuBase
  alias theo_liminv_buy_ok on_buy_ok
  def on_buy_ok
    @number_window.mode = :buy
    theo_liminv_buy_ok
  end
  
  alias theo_liminv_sell_ok on_sell_ok
  def on_sell_ok
    @number_window.mode = :sell
    theo_liminv_sell_ok
  end
end

# =============================================================================
# ▼ Compatibility patch thingy
# =============================================================================

if $imported["YEA-MenuCursor"]
class Sprite_MenuCursor
  def opacity_rate
    rate = 16
    return -rate if !@window.active || @window.close?
    return rate
  end
end
end

if $imported[:mog_menu_cursor]
module CURSOR_MENU_SPRITE
  def can_update_cursor_position?
    return false if !self.active     
    return false if self.index < 0 
    return false if !self.visible
    return false if self.close?
    return true
  end
end
end

 

 

 

ti ringrazio buddy, lo propongo subito alla mia collega (è lei che comanda XD), per il resto non ci capisco nulla ahimè, non uso questi tool (prima o poi ci far qualcosa di mio, ma per ora faccio da asisstente asd), per questo ho postato quegli script così com'erano, con quelle due modifiche che ho cercato di fare basandomi su quel poco (quasi niente) che so di programmazione in generale XDDD

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

  • 0

Io non capisco nulla in generale, eppure guarda come sono in forma.

Lo script mantiene (ma sono disattivabili) un paio di fronzoli, come il rallentare la camminata. Di default aggiunge un paio di finestrelle, quindi richiede un paio di martellate per combinarlo col DKP Menu.

Link to comment
Share on other sites

  • 0

Io non capisco nulla in generale, eppure guarda come sono in forma.

 

Lo script mantiene (ma sono disattivabili) un paio di fronzoli, come il rallentare la camminata. Di default aggiunge un paio di finestrelle, quindi richiede un paio di martellate per combinarlo col DKP Menu.

 

ma tu sei un troll, ti puoi rigenerare XD

 

scherzi a parte, l'ho fatto vedere alla mia amica che ha approvato subito (gia sta facendo le dovute modifiche asd); per il fatto del combinare oggetti? puoi darmi qualche dritta?

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

  • 0

Siamo finalmente riusciti ad editare il post.

 

Ghost, sei sicuro che l'ultimo "script" (che sono una quintalata di script tutti nello stesso posto) sia proprio da postare così? Tutte quelle classi sono state editate?

Chiedo perchè è molto illeggibile ed anche se non sono un programmatore, già immagino le imprecazioni di chi tenterà di capisci qualcosa da quel collage! XD

Deviantart

ElfGamesWorks Forum

My adventure game
Little Briar Rose

Altri progetti: Oh! I'm Getting Taller! / Il pifferaio di Hamelin

I miei Fumetti: Folletto Vs Nenè / A.s.D. / A.s.D.2

http://www.rpg2s.net/img/fablecontest1st.pnghttp://rpg2s.net/gif/SCContest3Oct.gif http://i43.tinypic.com/1zokd2s.png http://i.imgur.com/qRfaRqE.png http://i43.tinypic.com/eger81.gifhttp://i.imgur.com/BEu6G.gifhttp://i43.tinypic.com/eger81.gif

Un sogno nel cassetto...

 

 

http://i.imgur.com/H1ARhq7.gif

 

 

Citaziò!

 

 

Il Coniglio, si sa, saltella con una gamba dietro ed una avanti, un braccino corto ed uno lungo, un'orecchia dritta ed una storta. Perchè il Coniglio odia la simmetria.

Flame: Io me lo sono fatto raccontare tutto il Sigmarillion ma ancora devo leggerlo (...)
Impaled Janus: Il Sighmarillion, un'opera molto triste.
Testament: Ma Flame mi sa che erra convinto, come al solito.

"Tu devi essere il chiacchierato FenriX, la cui fama deriva dall'arte di giungere rozzamente al sodo del concetto la maggior parte delle volte... detto in una via inoffensiva..." Una piaga in due righe, by Dr.Risolvo!

 

 


Scheda di Zuppo Del'Oquie


Nome - Zuppo Del'Oquie
Età - 76
Razza - Elvaan
Descrizione - Snello, faccia da cretino, cappelletto alla Robin Hood in testa con la piuma perennemente spiegazzata, maglia in pieno stile: "è la prima cosa che ho trovato in giro" e pantaloni uguali. Le scarpe invece sono forse l'unica cosa realmente sua. Di pelle morbida, salvo la base di cuoio, ottime per correre e fare poco rumore, prive di alcun tipo di tacco. Ed aldilà del vestiario, abbiamo una cerbottana, una fionda, un pugnaletto, una...un..ah no basta. Lo zainetto, si! Ma lì ci tiene il pane ed i suoi strumenti di dubbia qualità.
Poi..ha orecchie a punta come ogni Elvaan e capelli castano chiaro, bizzarremente brezzolati di ciocchette tendenti al biondo. E' un biondo fallito, in sostanza. Ah, ma a lui non importa molto. Detto, questo, null'altro di rilevante da segnalare.
Se non il fatto che, il più delle volte, sia vestiti che capelli che zaino sono ornati da una quasi perenne sensazione di Bagnato. Perchè ogni pozzanghera che esiste sulla faccia di questa terra, deve, senza via di scampo, finire contro il suo naso. O forse è lui che è legato all'elemento Acqua da un odio amore non espresso...?
Misteri del Fato.
Carattere - Simpatico, socievole, affabile, allegro, ed al tempo stesso estremamente indifferente alle questioni che non lo riguardano. Astuto, ma mai per cattiveria, decide lui a cosa affezionarsi ed a cosa no. Di mentalità molto..molto bizzarra, vive la vita con dei valori del tutto personali che possono essere a volte comprensibili ed in accordo con quelle altrui, o possono essere decisamente ridicoli agli occhi degli altri. Ma lui è fatto così e non ci ragiona poi molto su come è fatto. Finchè mantiene due braccia due gambe ed una testa, ritiene di essere fatto semplicemente perfetto per quel che gli serve!

Background - "Fratello minore. Si, minore! Oh si! DANNATAMENTE MINORE! E questo è un problema! Perchè è un problema, no? A logica dovrebbe essere un bel problema per chiunque abbia voglia di non essere sempre chiamato per secondo, interpellato solo all'ultimo come scorta, impegnato solo quando proprio tutti sono impegnati, considerato solo per fare numero. AH! Minore! Onta! Orgoglio! AH!
AH!
A...ahah! Ma col cavolo..è una pacchia!"

Tranquillamente adagiato sul suo enorme divano, perchè se l'erba è il cuscino, un colle è dunque un enorme divano, Zuppo stava fischiettando con una foglia di acetella in bocca, così univa l'utile (il fischiettare era molto utile a parer suo) con il dilettevole (e quella fogliolina aveva un buon sapore, perciò dilettevolmente saporita!).
Era a dir poco splendido compiere un'attività tanto impegnativa e semplice al contempo da giustificare la sua lunga, perenne, praticamente insindacabile assenza a qualsivoglia attività sociale.
Lui disegnava le mappe, ed il fratellone le spacciava per sue guadagnando una montagna di soldi, tanta era l'accuratezza delle zone anche più inesplorabili, ed in cambio il Brò gli garantiva una vita tranquilla e senza impegni. Oh, fratello minore, ma il maggiore era tutto merito suo!
Poi, all'improvviso, tutto cambiò.
Perchè serve sempre un grande cambiamento per una grande svolta, no?
Ebbene, da quel momento lui partì, viaggiò, abbandonò la sua colonia, perseguì la via del "faccio da solo e meglio mi sento".
Tutto questo a causa sua..a causa loro...!!

"Fra'? Dove hai messo il mio flauto di rape?"
"Uh..era ammuffito. L'ho buttato anni fa ormai."
"..che..CHE COSA HAI FATTO!?!?!"

Inaudito.
Ovvio e logico andarsene, no? Sono certo che voi tutti sarete daccordo con me! NON SI TOCCANO I FLAUTI DI RAPE ALTRUI! MUFFA O NON MUFFA!
Beh si, daccordo, forse lo aveva dimenticato per gli ultimi vent'anni, ma questo non cambiava le cose. Dannato fratello. E.....no, non se ne era andato solo per quello, cosa credete!?

"...Mamma...Fra' ha buttato il mio flauto di rape."
"Ah, deve essere ammuffito come l'ocarina di zucca che ho buttato l'altro ieri."
"...che...CHE COSA HAI FATTO!?!?!?!"

Ovvio che non bastava un flauto a mandarlo via. Ma due, dai è troppo! L'aveva terminata, quell'ocarina, appena tre anni prima. ERA NUOVA!
E così, imparata la lezione del "non si lascia nulla in casa altrui", perchè quella non era PIU' la sua casa, Zuppo prese ogni cosa di valore che aveva con se: dunque uno svariato elenco di strumenti da ortolano, a partire dal triangolo di selci alla trombetta di cavolfiore, e partì. Partì, lasciandosi dietro una città perfetta, con una vita perfetta, una famiglia perfetta, ed una stupida, sciocca, banale idea che questa perfezione sarebbe durata in eterno.
Ah. Ma non scordiamoci un dettaglio.

Partì. Attraversò la strada. Il ponte. Il fiume. Inciampò. Cadde nella pozza vicino al fiume. Si inzuppò. Si rialzò e ri-partì.
Perchè il nome se lo era guadagnato con molta sfigata fatica eh.

"Ma che bel bambino, signora Ouquie!"
"...oh...scusatemi, riposavo. Quale bambino?"
"Hemm..quello che tenete nella culla."
"Oh! Quel bambino! Oh si ve lo faccio vedere subit.." E con un braccio, la maldestra madre intruppò la culla, che era ovviamente posizionata di fianco alla finestra aperta, che vide ovviamente un infante venire catapultato fuori, e che, alfine, vide sempre ovviamente il medesimo infante finire a mollo nel fiume, per fortuna abbastanza profondo, che passava proprio adiacente le mura della piccola dimora.
Quando lo ripresero, era vivo. Zuppo, ma vivo.
E Zuppo rimase a vita.

I reumatismi sarebbero arrivati in vecchiaia.

Equip -
Pugnale comune - Prezzo: 9
Armatura di Cuio [1 PA] - Prezzo: 15
Borsa Comune - Prezzo: 10
Fionda - Prezzo(pagato da madre natura XD)

 

Link to comment
Share on other sites

  • 0

No ho copiato dal post sotto come chiesto da Ghost. Intanto serviva a fixare il post perchè dava persino problemi nella lettura del topic, caricamenti infiniti, lag, cose così.

Se poi vi accordate e c'è da modificare altro, ora dovrebbe riuscirci Ghost stesso. Non ho sufficiente competenza per decidere quale script è meglio, però ero online, passavo di qui ed ho fixato il problema col post, sotto richiesta d Dax che non riusciva a modificarlo.

Banalmente a me si caricava e ne ho approfittato. Ora non dovrebbe dare più problemi.

 

La parte più concreta la lascerei a voi. Non capisco niente di scripts! XD

Deviantart

ElfGamesWorks Forum

My adventure game
Little Briar Rose

Altri progetti: Oh! I'm Getting Taller! / Il pifferaio di Hamelin

I miei Fumetti: Folletto Vs Nenè / A.s.D. / A.s.D.2

http://www.rpg2s.net/img/fablecontest1st.pnghttp://rpg2s.net/gif/SCContest3Oct.gif http://i43.tinypic.com/1zokd2s.png http://i.imgur.com/qRfaRqE.png http://i43.tinypic.com/eger81.gifhttp://i.imgur.com/BEu6G.gifhttp://i43.tinypic.com/eger81.gif

Un sogno nel cassetto...

 

 

http://i.imgur.com/H1ARhq7.gif

 

 

Citaziò!

 

 

Il Coniglio, si sa, saltella con una gamba dietro ed una avanti, un braccino corto ed uno lungo, un'orecchia dritta ed una storta. Perchè il Coniglio odia la simmetria.

Flame: Io me lo sono fatto raccontare tutto il Sigmarillion ma ancora devo leggerlo (...)
Impaled Janus: Il Sighmarillion, un'opera molto triste.
Testament: Ma Flame mi sa che erra convinto, come al solito.

"Tu devi essere il chiacchierato FenriX, la cui fama deriva dall'arte di giungere rozzamente al sodo del concetto la maggior parte delle volte... detto in una via inoffensiva..." Una piaga in due righe, by Dr.Risolvo!

 

 


Scheda di Zuppo Del'Oquie


Nome - Zuppo Del'Oquie
Età - 76
Razza - Elvaan
Descrizione - Snello, faccia da cretino, cappelletto alla Robin Hood in testa con la piuma perennemente spiegazzata, maglia in pieno stile: "è la prima cosa che ho trovato in giro" e pantaloni uguali. Le scarpe invece sono forse l'unica cosa realmente sua. Di pelle morbida, salvo la base di cuoio, ottime per correre e fare poco rumore, prive di alcun tipo di tacco. Ed aldilà del vestiario, abbiamo una cerbottana, una fionda, un pugnaletto, una...un..ah no basta. Lo zainetto, si! Ma lì ci tiene il pane ed i suoi strumenti di dubbia qualità.
Poi..ha orecchie a punta come ogni Elvaan e capelli castano chiaro, bizzarremente brezzolati di ciocchette tendenti al biondo. E' un biondo fallito, in sostanza. Ah, ma a lui non importa molto. Detto, questo, null'altro di rilevante da segnalare.
Se non il fatto che, il più delle volte, sia vestiti che capelli che zaino sono ornati da una quasi perenne sensazione di Bagnato. Perchè ogni pozzanghera che esiste sulla faccia di questa terra, deve, senza via di scampo, finire contro il suo naso. O forse è lui che è legato all'elemento Acqua da un odio amore non espresso...?
Misteri del Fato.
Carattere - Simpatico, socievole, affabile, allegro, ed al tempo stesso estremamente indifferente alle questioni che non lo riguardano. Astuto, ma mai per cattiveria, decide lui a cosa affezionarsi ed a cosa no. Di mentalità molto..molto bizzarra, vive la vita con dei valori del tutto personali che possono essere a volte comprensibili ed in accordo con quelle altrui, o possono essere decisamente ridicoli agli occhi degli altri. Ma lui è fatto così e non ci ragiona poi molto su come è fatto. Finchè mantiene due braccia due gambe ed una testa, ritiene di essere fatto semplicemente perfetto per quel che gli serve!

Background - "Fratello minore. Si, minore! Oh si! DANNATAMENTE MINORE! E questo è un problema! Perchè è un problema, no? A logica dovrebbe essere un bel problema per chiunque abbia voglia di non essere sempre chiamato per secondo, interpellato solo all'ultimo come scorta, impegnato solo quando proprio tutti sono impegnati, considerato solo per fare numero. AH! Minore! Onta! Orgoglio! AH!
AH!
A...ahah! Ma col cavolo..è una pacchia!"

Tranquillamente adagiato sul suo enorme divano, perchè se l'erba è il cuscino, un colle è dunque un enorme divano, Zuppo stava fischiettando con una foglia di acetella in bocca, così univa l'utile (il fischiettare era molto utile a parer suo) con il dilettevole (e quella fogliolina aveva un buon sapore, perciò dilettevolmente saporita!).
Era a dir poco splendido compiere un'attività tanto impegnativa e semplice al contempo da giustificare la sua lunga, perenne, praticamente insindacabile assenza a qualsivoglia attività sociale.
Lui disegnava le mappe, ed il fratellone le spacciava per sue guadagnando una montagna di soldi, tanta era l'accuratezza delle zone anche più inesplorabili, ed in cambio il Brò gli garantiva una vita tranquilla e senza impegni. Oh, fratello minore, ma il maggiore era tutto merito suo!
Poi, all'improvviso, tutto cambiò.
Perchè serve sempre un grande cambiamento per una grande svolta, no?
Ebbene, da quel momento lui partì, viaggiò, abbandonò la sua colonia, perseguì la via del "faccio da solo e meglio mi sento".
Tutto questo a causa sua..a causa loro...!!

"Fra'? Dove hai messo il mio flauto di rape?"
"Uh..era ammuffito. L'ho buttato anni fa ormai."
"..che..CHE COSA HAI FATTO!?!?!"

Inaudito.
Ovvio e logico andarsene, no? Sono certo che voi tutti sarete daccordo con me! NON SI TOCCANO I FLAUTI DI RAPE ALTRUI! MUFFA O NON MUFFA!
Beh si, daccordo, forse lo aveva dimenticato per gli ultimi vent'anni, ma questo non cambiava le cose. Dannato fratello. E.....no, non se ne era andato solo per quello, cosa credete!?

"...Mamma...Fra' ha buttato il mio flauto di rape."
"Ah, deve essere ammuffito come l'ocarina di zucca che ho buttato l'altro ieri."
"...che...CHE COSA HAI FATTO!?!?!?!"

Ovvio che non bastava un flauto a mandarlo via. Ma due, dai è troppo! L'aveva terminata, quell'ocarina, appena tre anni prima. ERA NUOVA!
E così, imparata la lezione del "non si lascia nulla in casa altrui", perchè quella non era PIU' la sua casa, Zuppo prese ogni cosa di valore che aveva con se: dunque uno svariato elenco di strumenti da ortolano, a partire dal triangolo di selci alla trombetta di cavolfiore, e partì. Partì, lasciandosi dietro una città perfetta, con una vita perfetta, una famiglia perfetta, ed una stupida, sciocca, banale idea che questa perfezione sarebbe durata in eterno.
Ah. Ma non scordiamoci un dettaglio.

Partì. Attraversò la strada. Il ponte. Il fiume. Inciampò. Cadde nella pozza vicino al fiume. Si inzuppò. Si rialzò e ri-partì.
Perchè il nome se lo era guadagnato con molta sfigata fatica eh.

"Ma che bel bambino, signora Ouquie!"
"...oh...scusatemi, riposavo. Quale bambino?"
"Hemm..quello che tenete nella culla."
"Oh! Quel bambino! Oh si ve lo faccio vedere subit.." E con un braccio, la maldestra madre intruppò la culla, che era ovviamente posizionata di fianco alla finestra aperta, che vide ovviamente un infante venire catapultato fuori, e che, alfine, vide sempre ovviamente il medesimo infante finire a mollo nel fiume, per fortuna abbastanza profondo, che passava proprio adiacente le mura della piccola dimora.
Quando lo ripresero, era vivo. Zuppo, ma vivo.
E Zuppo rimase a vita.

I reumatismi sarebbero arrivati in vecchiaia.

Equip -
Pugnale comune - Prezzo: 9
Armatura di Cuio [1 PA] - Prezzo: 15
Borsa Comune - Prezzo: 10
Fionda - Prezzo(pagato da madre natura XD)

 

Link to comment
Share on other sites

  • 0

grazie per aver sistemato il primo post, scusate per il casino, è che credevo di aver incollato soltanto lo script dark paladin ma mi sono portato mezzo forum dal quale l'ho copiato XDDDDDDDDDDDD

 

ne approfitto per chiedere un altra cosa riguardante proprio quest'ultimo script: se volessi inserire una scritta (o per la precisione due numeri seprati da una slash - A/B che sono valori di due variabili) in un punto preciso del menù, come dovrei fare? cioè so che esiste un comando draw_text ma suppongo vada usato in un certo modo, non a kaiser asd

http://imagizer.imageshack.us/a/img10/3981/ghostproductionusebar.png

http://imagizer.imageshack.us/a/img593/9448/ghostrideruserbar.png

 

Visita Il Mio Canale di Youtube - Tutorial per Principianti e Amatori, video recensioni, let's play e altro ancora sul mondo di Rpg Maker.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...