设为首页 收藏本站
登录 /立即注册 /找回密码

URPGs

快捷导航
  • 门户Portal
  • 论坛BBS
  • 群组Group
  • 导读Guide
  • 家园Space
  • 工具Tools
  • 广播Follow
  • 期刊Periodical
  • 排行榜Ranklist
  • 社区茶坊
  • pixlr图片编辑
  • 资源列表
  • photobucket
  • RMVA Lite [In English]
  • RM RTP
  • TryRUBY
  • RMXP+RMVX下载[VeryCD]
  • RMVA下载[66RPG]
搜索
  • 本版
  • 帖子
  • 用户
URPGs»论坛 › 提问区 › RPG Maker VX 提问区 › 怎样在事件中打开物品栏
返回列表 发新帖
查看: 4700|回复: 2

[解决] 怎样在事件中打开物品栏

[复制链接]
小小刀886
小小刀886 当前离线
积分
23
查看详细资料 窥视卡 雷达卡
发表于 2013-8-4 19:03:01 | 显示全部楼层 |阅读模式
本帖最后由 houyuxiaoyang 于 2013-8-22 22:24 编辑

RT,求大触帮忙..
回复

使用道具 举报

  • 提升卡
  • 置顶卡
  • 沉默卡
  • 喧嚣卡
  • 变色卡
  • 抢沙发
  • 千斤顶
  • 显身卡
Sonic1997
Sonic1997 当前离线
积分
212
查看详细资料 窥视卡 雷达卡
发表于 2013-8-5 01:42:06 | 显示全部楼层
[code=ruby]$scene = Scene_Item.new[/code]
这样. .?
回复 Like Dislike

使用道具 举报

  • 显身卡
orzfly
orzfly 当前离线
积分
55
查看详细资料 窥视卡 雷达卡
发表于 2013-8-5 02:10:43 | 显示全部楼层
噗……囧叔写过这个。

# 在事件中快速调用物品、技能、装备、状态菜单。
#------------------------------------------------------------------------------
# 使用方法:
#         您可以在事件的注释中使用如下的自然语言来调用:
#           o 显示物品界面
#           o 打开技能窗口
#           o 调用装备界面 3号角色
#           o 打开4号角色的状态
#           o 打开技能窗口哦~亲~我可以指定是哪个角色么?哦~是4号角色的哦~
#           o 打开3号角色的猥琐无比的真orzFly的技能窗口~
#
070509ueaa7eojnb0jdzou.png
[code=ruby]#==============================================================================
# ■ 注释调用系统接入包 1.0 [VX]
#   http://orzFly.com/RM/PowerComments
#------------------------------------------------------------------------------
# 为插件脚本的注释调用提供支持。需配合其他脚本使用。
#------------------------------------------------------------------------------
# PowerComments.register_command(args, proc)
#   - args 为 Regexp 或包含 Regexp 的 Array
#   - proc 为 Proc 对象
#          当 args 中任意一个 Regexp 对象能匹配事件注释中的文字时,将会调用 proc
#          调用 proc 时,将会传递下列参数:
#            o 当前事件解释器实例
#            o 成功匹配的 Regexp 的 last_match 数组
#
#          proc 的返回值将决定事件解释器的下一步动作
#            o 若 proc 的执行结果是 true
#                当前事件解释器实例 powercomments_repeat_count 归零
#                将继续执行事件中下一指令
#            o 若 proc 的执行结果是 false
#                当前事件解释器实例 powercomments_repeat_count 累加(+= 1)
#                将重复执行事件中当前指令
#------------------------------------------------------------------------------
# - 1.0 [VX] by orzFly [rm@orzfly.com]
#   * 首个版本
#==============================================================================
module PowerComments
  Version = "1.0"
  Commands = {}

  module_function
  def register_command(args, proc)
    if args.is_a?(Array)
      args.each { |arg| register_command_single(arg, proc) }
    else
      register_command_single(args, proc)
    end
  end
  def register_command_single(regexp, proc)
    if Commands.include?(regexp)
      raise("PowerComments Command " + regexp.to_s + " already exists")
    end
    Commands[regexp] = proc
  end
end

class Game_Interpreter
  alias :execute_command_powercomment :execute_command
  def execute_command
    if @index >= @list.size-1
      command_end
      return true
    else
      @params = @list[@index].parameters
      @indent = @list[@index].indent
      case @list[@index].code
        when 108
          return powercomments(@params[0])
        else
          return execute_command_powercomment
        return true
      end
    end
  end
  
  def powercomments(text)
    PowerComments::Commands.each {|k, v|
      if k =~ text
        result = v.call(self, *Regexp.last_match.to_a)
        @powercomments_repeat_count += 1 unless result
        @powercomments_repeat_count = 0 if result
        return result
      end
    }
    return true
  end
  
  attr_accessor :wait_count
  
  def powercomments_repeat_count
    return @powercomments_repeat_count.nil? ? 0 : @powercomments_repeat_count
  end
  
  def powercomments_repeat_count=(value)
    @powercomments_repeat_count = value
  end
end
#==============================================================================
# ■ 事件调用物品、技能、装备、状态菜单 1.0 [VX]
#   http://orzFly.com/RM/MoreSceneFromEvent
#------------------------------------------------------------------------------
# 在事件中快速调用物品、技能、装备、状态菜单。
#------------------------------------------------------------------------------
# 使用方法:
#
# 方法 1:推荐!与注释调用系统 http://orzFly.com/RM/PowerComments 配合使用。
#         需要注释调用系统 1.0 以上版本。请将本脚本置于注释调用系统接入包之下。
#         
#         您可以在事件的注释中使用如下的自然语言来调用:
#           o 显示物品界面
#           o 打开技能窗口
#           o 调用装备界面 3号角色
#           o 打开4号角色的状态
#           o 打开技能窗口哦~亲~我可以指定是哪个角色么?哦~是4号角色的哦~
#           o 打开3号角色的猥琐无比的真orzFly的技能窗口~
#
# 方法 2:事件中使用脚本调用。
#           o $game_temp.next_scene = "item"
#           o $game_temp.next_scene = ["skill", 0]
#           o $game_temp.next_scene = ["equip", 0]
#           o $game_temp.next_scene = ["status", 0]
#         其中 0 为角色队伍编号。队伍中第一位为 0,第二位为 1。以此类推。
#------------------------------------------------------------------------------
# - 1.0 [VX] by orzFly [rm@orzfly.com]
#   * 首个版本
#==============================================================================

class Scene_Map < Scene_Base
  alias update_scene_change_map_more_scene update_scene_change
  def update_scene_change
    return if $game_player.moving?
    return call_item if $game_temp.next_scene == "item"
    if $game_temp.next_scene.is_a?(Array)
      return call_skill($game_temp.next_scene[1]) \
        if $game_temp.next_scene[0] == "skill"
      return call_equip($game_temp.next_scene[1]) \
        if $game_temp.next_scene[0] == "equip"
      return call_status($game_temp.next_scene[1]) \
        if $game_temp.next_scene[0] == "status"
    end
    return update_scene_change_map_more_scene
  end
  def call_item
    $game_temp.next_scene = nil
    $scene = Scene_Item_Map.new
  end
  def call_skill(index)
    $game_temp.next_scene = nil
    $scene = Scene_Skill_Map.new(
      (index.nil? or $game_party.members[index].nil?) ? 0 : index
    )
  end
  def call_equip(index)
    $game_temp.next_scene = nil
    $scene = Scene_Equip_Map.new(
      (index.nil? or $game_party.members[index].nil?) ? 0 : index
    )
  end
  def call_status(index)
    $game_temp.next_scene = nil
    $scene = Scene_Status_Map.new(
      (index.nil? or $game_party.members[index].nil?) ? 0 : index
    )
  end
end

["Scene_Item", "Scene_Skill", "Scene_Equip", "Scene_Status"].each { |s|
  eval("class #{s}_Map<#{s};def return_scene;$scene=Scene_Map.new;end;end")
}

unless PowerComments.nil?
  if PowerComments.methods.include?("register_command")
    PowerComments.register_command(/^(打开|调用|显示).*?物品/, Proc.new {
      $game_temp.next_scene = "item"
      true
    })
    PowerComments.register_command(/
^(打开|调用|显示).*?([0-9]+).*?技能.*?$|
^(打开|调用|显示).*?技能.*?([0-9]+).*?$|
^(打开|调用|显示)[^0-9]*?技能[^0-9]*?$/x,
      Proc.new { |_, _, _, x, _, y, _|
        $game_temp.next_scene = [
          "skill",
          ((y.nil? or y == "") ? (
            (x.nil? or x == "") ? 0 : x.to_i - 1
          ) : y.to_i - 1)
        ]
        true
      }
    )
    PowerComments.register_command(/
^(打开|调用|显示).*?([0-9]+).*?装备.*?$|
^(打开|调用|显示).*?装备.*?([0-9]+).*?$|
^(打开|调用|显示)[^0-9]*?装备[^0-9]*?$/x,
      Proc.new { |_, _, _, x, _, y, _|
        $game_temp.next_scene = [
          "equip",
          ((y.nil? or y == "") ? (
            (x.nil? or x == "") ? 0 : x.to_i - 1
          ) : y.to_i - 1)
        ]
        true
      }
    )
    PowerComments.register_command(/
^(打开|调用|显示).*?([0-9]+).*?状态.*?$|
^(打开|调用|显示).*?状态.*?([0-9]+).*?$|
^(打开|调用|显示)[^0-9]*?状态[^0-9]*?$/x,
      Proc.new { |_, _, _, x, _, y, _|
        $game_temp.next_scene = [
          "status",
          ((y.nil? or y == "") ? (
            (x.nil? or x == "") ? 0 : x.to_i - 1
          ) : y.to_i - 1)
        ]
        true
      }
    )
  end
end[/code]

点评

satgo1546
(为什么不能写“给玩家看看4号这垃圾角色还剩多少HP吧”  发表于 2013-8-5 12:49
satgo1546
额………………………………  发表于 2013-8-5 12:26

评分

参与人数 2贡献 +1 经验 +100 收起 理由
小小刀886 + 100 感谢
houyuxiaoyang + 1 满意答案

查看全部评分

回复 Like Dislike

使用道具 举报

  • 显身卡
返回列表 发新帖
高级模式
B Color Image Link Quote Code Smilies
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

站点统计|Archiver|手机版|意见反馈[feedback]| URPGs RPG Maker 游戏制作讨论

GMT+8, 2025-5-9 14:58 , Processed in 0.029270 second(s), 8 queries .

Powered by Discuz! X3.5

© 2011-2019 URPGs (Discuz! X3.4 © 2001-2019 Comsenz Inc.)

积分 0, 距离下一级还需 积分
快速回复 返回顶部 返回列表