查看: 2115|回复: 1

[已经过期] 自己改的一个简单脚本 呼叫之后卡了

[复制链接]
梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
回帖
2158
发表于 2015-5-17 10:45:00 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我就想要一个和GameEnd画面一样的窗口 便搬运来试着改
我记得之前是成功的,我这次发现不行了……
请帮我看看哪里设置错了:
[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ Scene_End
#------------------------------------------------------------------------------
#  结束游戏画面
#==============================================================================

class Scene_newskill < Scene_MenuBase
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_command_window
  end
  #--------------------------------------------------------------------------
  # ● 结束前处理
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    close_command_window
  end
  #--------------------------------------------------------------------------
  # ● 生成背景
  #--------------------------------------------------------------------------
  def create_background
    super
    @background_sprite.tone.set(0, 0, 0, 128)
  end
  #--------------------------------------------------------------------------
  # ● 生成指令窗口
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_nskill.new
    @command_window.set_handler(:AddSkill, method(:command_AddSkill))
    @command_window.set_handler(:Skill, method(:command_Skill))
    @command_window.set_handler(:cancel,   method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # ● 关闭指令窗口
  #--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
  end
  #--------------------------------------------------------------------------
  # ● 指令“返回标题”
  #--------------------------------------------------------------------------
  def command_AddSkill
    SceneManager.call(Scene_AddSkill)
  end
  #--------------------------------------------------------------------------
  # ● 指令“退出”
  #--------------------------------------------------------------------------
  def command_Skill
    SceneManager.call(Scene_Skill)
  end
end
[/pre]
[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ Window_GameEnd
#------------------------------------------------------------------------------
#  游戏结束画面中,选择“返回标题/退出游戏”的窗口。
#==============================================================================

class Window_nskill < Window_Command
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # ● 获取窗口的宽度
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # ● 更新窗口的位置
  #--------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height - height) / 2
  end
  #--------------------------------------------------------------------------
  # ● 生成指令列表
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("技能习得", :AddSkill)
    add_command("技能列表", :Skill)
    add_command(Vocab::cancel,   :cancel)
  end
end
[/pre]
MenuCommand:
[pre lang="ruby"]    add_command("  技能",  :newskill,  main_commands_enabled)[/pre]
Scene_Menu:
[pre lang="ruby"]    @command_window.set_handler(:newskill,     method(:command_personal))[/pre]
[pre lang="ruby"]    when :newskill
      SceneManager.call(Scene_newskill)[/pre]

在menu呼叫的时候直接卡了……

坑的进度如上                                                                                                        点击↑

梦石
1
星屑
23246
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2015-5-17 10:53:03 | 显示全部楼层
本帖最后由 喵呜喵5 于 2015-5-17 10:55 编辑

我这边测试的时候没有问题

请检查是否和其他脚本发生冲突
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部