| 本帖最后由 Sion 于 2013-10-17 12:17 编辑 
 好霸气的大神。正好我遇到个难题至今未解,前来求教~~~~~~
 就像我的帖子:http://rpg.blue/thread-335835-1-1.html 之中说到的一样,我希望能够在金币窗口显示身上某些道具的数量(目前是两个)来作为增加的货币使用。就像魔兽世界的正义,勇气,征服点数那样的货币。
 以此衍生,可以额外添加一个菜单选项和对应的菜单页面(暂时命名为货币页面),将包括金币在内的各种扩展货币都显示在里面。形成类似魔兽世界的货币页面一样的东西。
 但是由于技术有限,目前只完成了我发的帖子里面的效果,读不出变量:$game_party.item_number(83)的值。
 之所以要做成显示身上物品数这个效果是因为这样可以比较方便的设置掉落,以及使扩展货币的种类不受限制。同时我还是用了另一个物品分类脚本,通过修改使这些设置为扩展货币的物品不在包包中显示,也正是应为不在包包中显示所以也就需要另开显示他们的窗口,一开始想到的就是金币窗口了,于是拉长的金币窗口,做成了如图效果。
 
 回来附上使用的物品种类扩充脚本。
 
 
 ![]() 
 #==============================================================================#  功能:[RMVA]增加物品栏类别#  作者:ScottyFan#  版本:v1.0 2013.8.8#  使用说明:#         在数据库-物品(包括装备)-备注 里写入 @itype[位置编号]#         新的物品分类编号是从 1 开始。比如 @itype[1]或者@itype[2]#==============================================================================module SFS  CATEGORY = [   #格式["显示名称", :标识],  标识随便写,不重复即可    ["",     :default], #注意,不要更改此行    ["消耗", :potion],  #此处为编号1    ["货币", :money],   #此处是在背包中隐藏    ]end class RPG::BaseItem  attr_reader   :category_id  def category_id    return if self.is_a?(RPG::Skill)    if @category_id.nil?      /@itype\[(.+?)\]/ =~ @note      @category_id = $1.to_i    end    @category_id  endend  class Window_ItemCategory  #--------------------------------------------------------------------------  # ● 生成指令列表  #--------------------------------------------------------------------------  def make_command_list#    SFS::CATEGORY.each do |itype|#      next if itype[1] == :default#      add_command(itype[0],  itype[1])#    end    add_command("消耗",     :potion)    add_command("材料",     :item)    add_command(Vocab::weapon,   :weapon)    add_command(Vocab::armor,    :armor)    add_command(Vocab::key_item, :key_item)  endend  class Window_ItemList  #--------------------------------------------------------------------------  # ● 查询列表中是否含有此物品  #--------------------------------------------------------------------------  def include?(item)    if item && item.category_id > 0 #如果是特殊类别      return @category == SFS::CATEGORY[item.category_id][1]    end    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  endend
#============================================================================== 
#  功能:[RMVA]增加物品栏类别 
#  作者:ScottyFan 
#  版本:v1.0 2013.8.8 
#  使用说明: 
#         在数据库-物品(包括装备)-备注 里写入 @itype[位置编号] 
#         新的物品分类编号是从 1 开始。比如 @itype[1]或者@itype[2] 
#============================================================================== 
module SFS 
  CATEGORY = [   #格式["显示名称", :标识],  标识随便写,不重复即可 
    ["",     :default], #注意,不要更改此行 
    ["消耗", :potion],  #此处为编号1 
    ["货币", :money],   #此处是在背包中隐藏 
    ] 
end 
  
class RPG::BaseItem 
  attr_reader   :category_id 
  def category_id 
    return if self.is_a?(RPG::Skill) 
    if @category_id.nil? 
      /@itype\[(.+?)\]/ =~ @note 
      @category_id = $1.to_i 
    end 
    @category_id 
  end 
end 
  
  
class Window_ItemCategory 
  #-------------------------------------------------------------------------- 
  # ● 生成指令列表 
  #-------------------------------------------------------------------------- 
  def make_command_list 
#    SFS::CATEGORY.each do |itype| 
#      next if itype[1] == :default 
#      add_command(itype[0],  itype[1]) 
#    end 
    add_command("消耗",     :potion) 
    add_command("材料",     :item) 
    add_command(Vocab::weapon,   :weapon) 
    add_command(Vocab::armor,    :armor) 
    add_command(Vocab::key_item, :key_item) 
  end 
end 
  
  
class Window_ItemList 
  #-------------------------------------------------------------------------- 
  # ● 查询列表中是否含有此物品 
  #-------------------------------------------------------------------------- 
  def include?(item) 
    if item && item.category_id > 0 #如果是特殊类别 
      return @category == SFS::CATEGORY[item.category_id][1] 
    end 
    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 
end 
 
 |