设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1246|回复: 4
打印 上一主题 下一主题

[已经解决] 怎么修改脚本可以把装备里的盾和头盔给去掉?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2011-8-7
帖子
8
跳转到指定楼层
1
发表于 2011-8-8 20:09:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
我不想弄盾和头盔了,该怎么从脚本里去掉?就是说在游戏的时候打开装备栏里面看不到盾和头盔。

Lv1.梦旅人

梦石
0
星屑
49
在线时间
486 小时
注册时间
2009-7-23
帖子
449
2
发表于 2011-8-8 21:33:17 | 只看该作者
本帖最后由 2578699 于 2011-8-8 21:33 编辑

在Window_EquipRight中修改描绘
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
117
在线时间
432 小时
注册时间
2010-7-14
帖子
111
3
发表于 2011-8-9 10:33:28 | 只看该作者
可以在数据库里改名称啊  不想要盾和头盔可以改成 袜子 裤衩什么的...
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2011-8-7
帖子
8
4
 楼主| 发表于 2011-8-9 15:07:16 | 只看该作者
frostkankan 发表于 2011-8-9 10:33
可以在数据库里改名称啊  不想要盾和头盔可以改成 袜子 裤衩什么的... ...

能不能让他们消失……
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
48 小时
注册时间
2010-8-26
帖子
68
5
发表于 2011-8-16 12:07:10 | 只看该作者
如果你是用原版装备脚本的话,可以把数据库打开,把“盾”换成“身体”,把“头”换成“装饰品”,如图:
然后把脚本“Scene_Equip”替换成下面的脚本:
  1. #==============================================================================
  2. # ■ Scene_Equip
  3. #------------------------------------------------------------------------------
  4. #  处理装备画面的类。
  5. #==============================================================================

  6. class Scene_Equip
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     actor_index : 角色索引
  10.   #     equip_index : 装备索引
  11.   #--------------------------------------------------------------------------
  12.   def initialize(actor_index = 0, equip_index = 0)
  13.     @actor_index = actor_index
  14.     @equip_index = equip_index
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 主处理
  18.   #--------------------------------------------------------------------------
  19.   def main
  20.     # 获取角色
  21.     @actor = $game_party.actors[@actor_index]
  22.     # 生成窗口
  23.     @help_window = Window_Help.new
  24.     @left_window = Window_EquipLeft.new(@actor)
  25.     @right_window = Window_EquipRight.new(@actor)
  26.     @item_window1 = Window_EquipItem.new(@actor, 0)
  27.     @item_window2 = Window_EquipItem.new(@actor, 1)
  28.     @item_window3 = Window_EquipItem.new(@actor, 2)

  29.     # 关联帮助窗口
  30.     @right_window.help_window = @help_window
  31.     @item_window1.help_window = @help_window
  32.     @item_window2.help_window = @help_window
  33.     @item_window3.help_window = @help_window
  34.    
  35.     # 设置光标位置
  36.     @right_window.index = @equip_index
  37.     refresh
  38.     # 执行过渡
  39.     Graphics.transition
  40.     # 主循环
  41.     loop do
  42.       # 刷新游戏画面
  43.       Graphics.update
  44.       # 刷新输入信息
  45.       Input.update
  46.       # 刷新画面
  47.       update
  48.       # 如果画面切换的话的就中断循环
  49.       if $scene != self
  50.         break
  51.       end
  52.     end
  53.     # 准备过渡
  54.     Graphics.freeze
  55.     # 释放窗口
  56.     @help_window.dispose
  57.     @left_window.dispose
  58.     @right_window.dispose
  59.     @item_window1.dispose
  60.     @item_window2.dispose
  61.     @item_window3.dispose
  62.    
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 刷新
  66.   #--------------------------------------------------------------------------
  67.   def refresh
  68.     # 设置物品窗口的可视状态
  69.     @item_window1.visible = (@right_window.index == 0)
  70.     @item_window2.visible = (@right_window.index == 1)
  71.     @item_window3.visible = (@right_window.index == 2)
  72.   
  73.     # 获取当前装备中的物品
  74.     item1 = @right_window.item
  75.     # 设置当前的物品窗口到 @item_window
  76.     case @right_window.index
  77.     when 0
  78.       @item_window = @item_window1
  79.     when 1
  80.       @item_window = @item_window2
  81.     when 2
  82.       @item_window = @item_window3

  83.     end
  84.     # 右窗口被激活的情况下
  85.     if @right_window.active
  86.       # 删除变更装备后的能力
  87.       @left_window.set_new_parameters(nil, nil, nil)
  88.     end
  89.     # 物品窗口被激活的情况下
  90.     if @item_window.active
  91.       # 获取现在选中的物品
  92.       item2 = @item_window.item
  93.       # 变更装备
  94.       last_hp = @actor.hp
  95.       last_sp = @actor.sp
  96.       @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  97.       # 获取变更装备后的能力值
  98.       new_atk = @actor.atk
  99.       new_pdef = @actor.pdef
  100.       new_mdef = @actor.mdef
  101.       # 返回到装备
  102.       @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  103.       @actor.hp = last_hp
  104.       @actor.sp = last_sp
  105.       # 描画左窗口
  106.       @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
  107.     end
  108.   end
  109.   #--------------------------------------------------------------------------
  110.   # ● 刷新画面
  111.   #--------------------------------------------------------------------------
  112.   def update
  113.     # 刷新窗口
  114.     @left_window.update
  115.     @right_window.update
  116.     @item_window.update
  117.     refresh
  118.     # 右侧窗口被激活的情况下: 调用 update_right
  119.     if @right_window.active
  120.       update_right
  121.       return
  122.     end
  123.     # 物品窗口被激活的情况下: 调用 update_item
  124.     if @item_window.active
  125.       update_item
  126.       return
  127.     end
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 刷新画面 (右侧窗口被激活的情况下)
  131.   #--------------------------------------------------------------------------
  132.   def update_right
  133.     # 按下 B 键的情况下
  134.     if Input.trigger?(Input::B)
  135.       # 演奏取消 SE
  136.       $game_system.se_play($data_system.cancel_se)
  137.       # 切换到菜单画面
  138.       $scene = Scene_Menu.new(2)
  139.       return
  140.     end
  141.     # 按下 C 键的情况下
  142.     if Input.trigger?(Input::C)
  143.       # 固定装备的情况下
  144.       if @actor.equip_fix?(@right_window.index)
  145.         # 演奏冻结 SE
  146.         $game_system.se_play($data_system.buzzer_se)
  147.         return
  148.       end
  149.       # 演奏确定 SE
  150.       $game_system.se_play($data_system.decision_se)
  151.       # 激活物品窗口
  152.       @right_window.active = false
  153.       @item_window.active = true
  154.       @item_window.index = 0
  155.       return
  156.     end
  157.     # 按下 R 键的情况下
  158.     if Input.trigger?(Input::R)
  159.       # 演奏光标 SE
  160.       $game_system.se_play($data_system.cursor_se)
  161.       # 移至下一位角色
  162.       @actor_index += 1
  163.       @actor_index %= $game_party.actors.size
  164.       # 切换到别的装备画面
  165.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  166.       return
  167.     end
  168.     # 按下 L 键的情况下
  169.     if Input.trigger?(Input::L)
  170.       # 演奏光标 SE
  171.       $game_system.se_play($data_system.cursor_se)
  172.       # 移至上一位角色
  173.       @actor_index += $game_party.actors.size - 1
  174.       @actor_index %= $game_party.actors.size
  175.       # 切换到别的装备画面
  176.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  177.       return
  178.     end
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 刷新画面 (物品窗口被激活的情况下)
  182.   #--------------------------------------------------------------------------
  183.   def update_item
  184.     # 按下 B 键的情况下
  185.     if Input.trigger?(Input::B)
  186.       # 演奏取消 SE
  187.       $game_system.se_play($data_system.cancel_se)
  188.       # 激活右侧窗口
  189.       @right_window.active = true
  190.       @item_window.active = false
  191.       @item_window.index = -1
  192.       return
  193.     end
  194.     # 按下 C 键的情况下
  195.     if Input.trigger?(Input::C)
  196.       # 演奏装备 SE
  197.       $game_system.se_play($data_system.equip_se)
  198.       # 获取物品窗口现在选择的装备数据
  199.       item = @item_window.item
  200.       # 变更装备
  201.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  202.       # 激活右侧窗口
  203.       @right_window.active = true
  204.       @item_window.active = false
  205.       @item_window.index = -1
  206.       # 再生成右侧窗口、物品窗口的内容
  207.       @right_window.refresh
  208.       @item_window.refresh
  209.       return
  210.     end
  211.   end
  212. end
复制代码
再找到“Window_EquipRight”,把脚本替换成
  1. #==============================================================================
  2. # ■ Window_EquipRight
  3. #------------------------------------------------------------------------------
  4. #  装备画面、显示角色现在装备的物品的窗口。
  5. #==============================================================================

  6. class Window_EquipRight < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     actor : 角色
  10.   #--------------------------------------------------------------------------
  11.   def initialize(actor)
  12.     super(272, 64, 368, 192)
  13.     self.contents = Bitmap.new(width - 32, height - 32)
  14.     @actor = actor
  15.     refresh
  16.     self.index = 0
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 获取物品
  20.   #--------------------------------------------------------------------------
  21.   def item
  22.     return @data[self.index]
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 刷新
  26.   #--------------------------------------------------------------------------
  27.   def refresh
  28.     self.contents.clear
  29.     @data = []
  30.     @data.push($data_weapons[@actor.weapon_id])
  31.     @data.push($data_armors[@actor.armor1_id])
  32.     @data.push($data_armors[@actor.armor2_id])
  33.   
  34.     @item_max = @data.size
  35.     self.contents.font.color = system_color
  36.     self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  37.     self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  38.     self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  39.   
  40.     draw_item_name(@data[0], 92, 32 * 0)
  41.     draw_item_name(@data[1], 92, 32 * 1)
  42.     draw_item_name(@data[2], 92, 32 * 2)
  43.    
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 刷新帮助文本
  47.   #--------------------------------------------------------------------------
  48.   def update_help
  49.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  50.   end
  51. end
复制代码
这样就把“盾”当作身体,把“头”当作装饰品,然后把后面两项删掉,从而达到效果。
没有什么是做不到的!
前方的路如何?不走怎么知道!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-21 00:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表