赞 | 289 |
VIP | 0 |
好人卡 | 0 |
积分 | 85 |
经验 | 0 |
最后登录 | 2019-7-14 |
在线时间 | 775 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 8498
- 在线时间
- 775 小时
- 注册时间
- 2017-11-10
- 帖子
- 1231
|
首先楼主您这个脚本是在RGSS2运行还是RGSS3运行的?
RGSS2默认并没有Scene_ItemBase这个场景。
RGSS3默认并不会有$scene = Scene_Map.new这个实例方法。
看脚本的样子还是RGSS3的结构。
附上正确的脚本给您参考一下。
- #encoding:utf-8
- #==============================================================================
- # ■ Scene_ItemBase
- #------------------------------------------------------------------------------
- # 物品画面和技能画面的共同父类
- #==============================================================================
- class Scene_ItemBase
- #--------------------------------------------------------------------------
- # ● 使用物品
- #--------------------------------------------------------------------------
- alias up_use_item use_item
- def use_item
- p 1
- if $data_items[21]
- use_status_item
- else
- up_use_item
- end
- end
- #--------------------------------------------------------------------------
- # ● 设定
- #--------------------------------------------------------------------------
- def use_status_item
- SceneManager.call(Scene_Status2)
- end
- end
- #==============================================================================
- # ■ Scene_Status2
- #------------------------------------------------------------------------------
- # Status2画面
- #==============================================================================
- class Scene_Status2 < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● 開始処理
- #--------------------------------------------------------------------------
- alias xxx001_start start
- def start
- xxx001_start
- @status2_window = Window_Status2.new(0,0)
- @status2_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # ●返回地圖
- #--------------------------------------------------------------------------
- def return_scene
- SceneManager.call(Scene_Map)
- end
- end
- #==============================================================================
- # ■ Window_Status2
- #------------------------------------------------------------------------------
- #==============================================================================
- class Window_Status2 < Window_Selectable
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, window_width, window_height)
- @actor = $game_party.leader
- refresh
- activate
- end
- #--------------------------------------------------------------------------
- # ● 幅
- #--------------------------------------------------------------------------
- def window_width
- Graphics.width - 160
- end
- #--------------------------------------------------------------------------
- # ● 高
- #--------------------------------------------------------------------------
- def window_height
- Graphics.height - 123
- end
- #--------------------------------------------------------------------------
- # ● 1區塊
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_block1 (line_height * 0)
- end
- #--------------------------------------------------------------------------
- # ● 1區塊內容
- #--------------------------------------------------------------------------
- def draw_block1(y)
- draw_eexp_info(0, y)
- end
- # ● 內容描画
- #--------------------------------------------------------------------------
- def draw_eexp_info(x, y)
- s1 = @actor.max_level? ? "-------" : @actor.exp
- s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- change_color(system_color)
- draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
- draw_text(x, y + line_height * 1, 180, line_height, s_next)
- change_color(normal_color)
- draw_text(x, y + line_height * 0, 280, line_height, s1, 2)
- draw_text(x, y + line_height * 1, 280, line_height, s2, 2)
- end
- end
复制代码 |
|