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

Project1

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

[已经解决] 另外制作一个新状态栏,而且只能用道具查看,but...请问我...

[复制链接]

Lv4.逐梦者

梦石
0
星屑
8498
在线时间
775 小时
注册时间
2017-11-10
帖子
1231
1
发表于 2018-5-12 12:01:56 | 显示全部楼层
首先楼主您这个脚本是在RGSS2运行还是RGSS3运行的?
RGSS2默认并没有Scene_ItemBase这个场景。
RGSS3默认并不会有$scene = Scene_Map.new这个实例方法。
看脚本的样子还是RGSS3的结构。
附上正确的脚本给您参考一下。
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Scene_ItemBase
  4. #------------------------------------------------------------------------------
  5. #  物品画面和技能画面的共同父类
  6. #==============================================================================
  7. class Scene_ItemBase
  8.   #--------------------------------------------------------------------------
  9.   # ● 使用物品
  10.   #--------------------------------------------------------------------------
  11.   alias up_use_item use_item
  12.   def use_item
  13.     p 1
  14.     if $data_items[21]
  15.     use_status_item
  16.   else
  17.     up_use_item
  18.     end
  19.   end
  20.    #--------------------------------------------------------------------------
  21.   # ● 设定
  22.   #--------------------------------------------------------------------------
  23.   def use_status_item
  24.   SceneManager.call(Scene_Status2)
  25.   end
  26. end
  27. #==============================================================================
  28. # ■ Scene_Status2
  29. #------------------------------------------------------------------------------
  30. #  Status2画面
  31. #==============================================================================
  32. class Scene_Status2 < Scene_MenuBase
  33.   #--------------------------------------------------------------------------
  34.   # ● 開始処理
  35.   #--------------------------------------------------------------------------
  36.   alias xxx001_start start
  37.   def start
  38.     xxx001_start
  39.     @status2_window = Window_Status2.new(0,0)
  40.     @status2_window.set_handler(:cancel,   method(:return_scene))
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ●返回地圖
  44.   #--------------------------------------------------------------------------
  45.   def return_scene
  46.     SceneManager.call(Scene_Map)
  47.   end
  48. end
  49. #==============================================================================
  50. # ■ Window_Status2
  51. #------------------------------------------------------------------------------
  52. #==============================================================================
  53. class Window_Status2 < Window_Selectable
  54.   #--------------------------------------------------------------------------
  55.   def initialize(x, y)
  56.     super(x, y, window_width, window_height)
  57.     @actor = $game_party.leader
  58.     refresh
  59.     activate
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 幅
  63.   #--------------------------------------------------------------------------
  64.   def window_width
  65.     Graphics.width - 160
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● 高
  69.   #--------------------------------------------------------------------------
  70.   def window_height
  71.     Graphics.height - 123
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 1區塊
  75.   #--------------------------------------------------------------------------
  76.   def refresh
  77.     contents.clear
  78.     draw_block1   (line_height * 0)
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 1區塊內容
  82.   #--------------------------------------------------------------------------
  83.   def draw_block1(y)
  84.     draw_eexp_info(0, y)
  85.   end
  86.   # ● 內容描画
  87.   #--------------------------------------------------------------------------
  88.   def draw_eexp_info(x, y)
  89.     s1 = @actor.max_level? ? "-------" : @actor.exp
  90.     s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
  91.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  92.     change_color(system_color)
  93.     draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
  94.     draw_text(x, y + line_height * 1, 180, line_height, s_next)
  95.     change_color(normal_color)
  96.     draw_text(x, y + line_height * 0, 280, line_height, s1, 2)
  97.     draw_text(x, y + line_height * 1, 280, line_height, s2, 2)
  98.   end
  99. end
复制代码
一个只会简单事件的Rm新人,脚本完全不懂。只求做个简单的游戏完成自己的游戏之梦而已。
第一个游戏已经完成,等待各素材的完成和测试。
回复 支持 1 反对 0

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
8498
在线时间
775 小时
注册时间
2017-11-10
帖子
1231
2
发表于 2018-5-12 13:48:40 | 显示全部楼层
  1. #==============================================================================
  2. # ■ Scene_ItemBase
  3. #------------------------------------------------------------------------------
  4. #  物品画面和技能画面的共同父类
  5. #==============================================================================
  6. class Scene_ItemBase < Scene_MenuBase
  7.   #--------------------------------------------------------------------------
  8.   # ● 使用物品
  9.   #--------------------------------------------------------------------------
  10.   alias up_use_item use_item
  11.   def use_item
  12.    up_use_item
  13.    use_status_item if item.note.include?("<状态>")
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 设定
  17.   #--------------------------------------------------------------------------
  18.   def use_status_item
  19.   SceneManager.call(Scene_Status2)
  20.   end
  21. end
复制代码

换一种判断方法吧,就是打开状态菜单的道具备注里填入<状态>即可。

评分

参与人数 1星屑 +100 收起 理由
怪蜀黍 + 100 认可答案

查看全部评分

一个只会简单事件的Rm新人,脚本完全不懂。只求做个简单的游戏完成自己的游戏之梦而已。
第一个游戏已经完成,等待各素材的完成和测试。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 22:08

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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