查看: 2051|回复: 3

[已经过期] 求VX的SuperDebug脚本

[复制链接]
梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
回帖
13
发表于 2015-6-24 06:51:59 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 pjy612 于 2015-6-24 06:56 编辑

(。・∀・)ノ゙我又来求脚本了。。。o(╯□╰)o
已经在论坛搜过,只找到一个这个 https://rpg.blue/forum.php?mod=viewthread&tid=235912
但是不知道为啥有时候会出现 266-271行
  1.   def refresh
  2.     create_contents
  3.     for i in 0...@item_max
  4.       draw_item(i)
  5.     end
  6.   end
复制代码



这段 有时候会出 bitmap 创建失败然后就崩了 = =。

create_contents的对应调用位置在
   
class Window_Selectable < Window_Base
的 create_contents

感觉是 销毁已销毁过的 contents
咱是ruby白 = =。完全不知道它是在哪里的
用异常处理查的话 或者 判断是否已经 disposed? 会出现各种奇葩问题 无奈了 QAQ


所以问问还有没有其他类似的脚本 日文的也行 自己尝试汉化下 吼吼~
梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
回帖
1643

开拓者

发表于 2015-6-24 09:07:18 | 显示全部楼层
我运行了一下完全没问题

  -fk: -azogi:
回复

使用道具 举报

梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
回帖
13
 楼主| 发表于 2015-6-24 11:22:49 | 显示全部楼层
kuerlulu 发表于 2015-6-24 09:07
我运行了一下完全没问题

嘛 不是总错 总错就好修了,@column_max 改成2 他就不错了,
我反正搞不懂原因

所以想问问还有没有其他同类型的脚本。。。
用的时候好取舍 QAQ
回复

使用道具 举报

梦石
0
星屑
90
在线时间
357 小时
注册时间
2006-3-3
回帖
163
发表于 2015-6-24 16:30:06 | 显示全部楼层
  1. #==============================================================================
  2. # ■ Debug拓展VX版
  3. #    作者IamI
  4. #------------------------------------------------------------------------------
  5. #  这个脚本的功能是:拓展Debug窗口的功能。
  6. #   功能一:在Debug窗口当中添加“E”一条,允许修改事件的独立开关。
  7. #   功能二:在Debug窗口按下shift键,将存档于一号档位。
  8. #   功能三:在Debug窗口显示伪·FPS。并不是很准确。
  9. #   功能四:允许在独立开关中做一些邪恶的事情。范例内效果很明显。
  10. #   怨念:此脚本只是本人练习VX用,没想到这样一个脚本我也能磨蹭几个小时= =
  11. #         啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊我退化了吗……
  12. #==============================================================================
  13. #==============================================================================
  14. # ■ Game_Map
  15. #------------------------------------------------------------------------------
  16. #  追加定义,取得地图ID
  17. #==============================================================================
  18. class Game_Map
  19.   attr_reader :map_id
  20. end
  21. #==============================================================================
  22. # ■ Game_Event
  23. #------------------------------------------------------------------------------
  24. #  追加定义,开放Event。
  25. #==============================================================================
  26. class Game_Event
  27.   attr_reader :event
  28. end
  29. #==============================================================================
  30. # ■ Game_SelfSwitches
  31. #------------------------------------------------------------------------------
  32. #  追加定义。使独立开关能够保存其他类型的值
  33. #==============================================================================
  34. NULLSTR = "Nil[OFF]"
  35. class Game_SelfSwitches
  36.   #--------------------------------------------------------------------------
  37.   # ● 获取自我开关
  38.   #     key : 键
  39.   #--------------------------------------------------------------------------
  40.   def [](key)
  41.     if @data[key] == nil
  42.       if key[2] == "A" or key[2] == "B" or key[2] == "C" or key[2] == "D"
  43.         return false
  44.       else
  45.         return NULLSTR
  46.       end
  47.     end
  48.     return @data[key]
  49.   end
  50. end

  51. #==============================================================================
  52. # ■ Window_FPS
  53. #------------------------------------------------------------------------------
  54. #  伪·FPS计算窗
  55. #==============================================================================
  56. class Window_FPS < Window_Base
  57.   def initialize
  58.     super(424,366,120,50)
  59.     @time = Time.now
  60.     @fs = 0
  61.     @fps = 60
  62.     refresh
  63.   end
  64.   def update
  65.     @fs += 1
  66.     nt = Time.now
  67.     tc = (nt - @time)
  68.     if tc >= 1
  69.       @fps = @fs
  70.       @fs = 0
  71.       @time = nt
  72.       refresh
  73.     end
  74.   end
  75.   def refresh
  76.     self.contents.clear
  77.     self.contents.draw_text(self.contents.rect,"伪FPS:" + @fps.to_s)
  78.   end
  79. end

  80. #==============================================================================
  81. # ■ Window_DebugLeft
  82. #------------------------------------------------------------------------------
  83. #  调试画面、指定开关及变量块的窗口。
  84. #==============================================================================

  85. class Window_DebugLeft < Window_Selectable
  86.   #--------------------------------------------------------------------------
  87.   # ● 初始化对象
  88.   #     x     : 窗口的 X 坐标
  89.   #     y     : 窗口的 Y 坐标
  90.   #--------------------------------------------------------------------------
  91.   def initialize(x, y)
  92.     super(x, y, 176, 416)
  93.     self.index = 0
  94.     refresh
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 刷新
  98.   #--------------------------------------------------------------------------
  99.   def refresh
  100.     @switch_max = ($data_system.switches.size - 1 + 9) / 10
  101.     @variable_max = ($data_system.variables.size - 1 + 9) / 10
  102.     @item_max = @switch_max + @variable_max + $game_map.events.values.size
  103.     create_contents
  104.     for i in 0...@item_max
  105.       draw_item(i)
  106.     end
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 描绘项目
  110.   #     index : 项目编号
  111.   #--------------------------------------------------------------------------
  112.   def draw_item(index)
  113.     if index < @switch_max
  114.       n = index * 10
  115.       text = sprintf("S [%04d-%04d]", n+1, n+10)
  116.     elsif index < @variable_max + @switch_max
  117.       n = (index - @switch_max) * 10
  118.       text = sprintf("V [%04d-%04d]", n+1, n+10)
  119.     else
  120.       n = (index - @switch_max - @variable_max)
  121.       text = "E " + $game_map.events.values[n].event.name
  122.     end
  123.     rect = item_rect(index)
  124.     rect.x += 4
  125.     rect.width -= 8
  126.     self.contents.clear_rect(rect)
  127.     self.contents.draw_text(rect, text)
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 获取模式
  131.   #--------------------------------------------------------------------------
  132.   def mode
  133.     if self.index < @switch_max
  134.       return 0
  135.     elsif self.index < @switch_max + @variable_max
  136.       return 1
  137.     else
  138.       return 2
  139.     end
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 获取开头显示部分的 ID
  143.   #--------------------------------------------------------------------------
  144.   def top_id
  145.     if self.index < @switch_max
  146.       return self.index * 10 + 1
  147.     elsif self.index < @switch_max + @variable_max
  148.       return (self.index - @switch_max) * 10 + 1
  149.     else
  150.       return self.index - @switch_max - @variable_max
  151.     end
  152.   end
  153. end

  154. #==============================================================================
  155. # ■ Window_DebugRight
  156. #------------------------------------------------------------------------------
  157. #  调试画面、单独显示开关以及变量的窗口。
  158. #==============================================================================

  159. class Window_DebugRight < Window_Selectable
  160.   #--------------------------------------------------------------------------
  161.   # ● 定义实例变量
  162.   #--------------------------------------------------------------------------
  163.   attr_reader   :mode                     # 模式 (0:开关、1:变量)
  164.   attr_reader   :top_id                   # 最前显示部分的 ID
  165.   #--------------------------------------------------------------------------
  166.   # ● 初始化对象
  167.   #     x : 窗口的 X 坐标
  168.   #     y : 窗口的 Y 坐标
  169.   #--------------------------------------------------------------------------
  170.   def initialize(x, y)
  171.     super(x, y, 368, 10 * WLH + 32)
  172.     self.index = -1
  173.     self.active = false
  174.     @item_max = 10
  175.     @mode = 0
  176.     @top_id = 1
  177.     @hash = {0 => "A",1 => "B",2 => "C",3 => "D",4 => "E",5 => "F",6 => "G",7 => "H",8 => "I",9 => "J"}
  178.     refresh
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 刷新
  182.   #--------------------------------------------------------------------------
  183.   def refresh
  184.     self.contents.clear
  185.     for i in 0...@item_max
  186.       draw_item(i)
  187.     end
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 描绘项目
  191.   #     index   : 项目编号
  192.   #--------------------------------------------------------------------------
  193.   def draw_item(index)
  194.     current_id = @top_id + index
  195.     id_text = sprintf("%04d:", current_id)
  196.     if @mode == 2
  197.       id_text = ""
  198.     end
  199.     id_width = self.contents.text_size(id_text).width
  200.     ############################################
  201.     color = false
  202.     ############################################
  203.     if @mode == 0
  204.       name = $data_system.switches[current_id]
  205.       status = $game_switches[current_id] ? "[ON]" : "[OFF]"
  206.     elsif @mode == 1
  207.       name = $data_system.variables[current_id]
  208.       status = $game_variables[current_id]
  209.     else
  210.       name = "独立开关" + @hash[index].to_s
  211.       status = $game_self_switches[[$game_map.map_id,@top_id + 1,@hash[index]]]
  212.       if status.is_a?(TrueClass) or status.is_a?(FalseClass)
  213.         status = status ? "[ON]" : "[OFF]"
  214.       else
  215.         unless status == NULLSTR
  216.           ############
  217.           color = true
  218.           ############
  219.           status = "[" + status.type.to_s + ":" + status.inspect + "]"
  220.         end
  221.       end
  222.     end
  223.     if name == nil
  224.       name = ""
  225.     end
  226.     rect = item_rect(index)
  227.     rect.x += 4
  228.     rect.width -= 8
  229.     self.contents.clear_rect(rect)
  230.     if color == false
  231.       self.contents.font.color = normal_color
  232.     else
  233.       self.contents.font.color = system_color
  234.     end
  235.     self.contents.draw_text(rect, id_text)
  236.     rect.x += id_width
  237.     rect.width -= id_width + 60
  238.     self.contents.draw_text(rect, name)
  239.     rect.width += 60
  240.     self.contents.draw_text(rect, status, 2)
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 设置模式
  244.   #     id : 新模式
  245.   #--------------------------------------------------------------------------
  246.   def mode=(mode)
  247.     if @mode != mode
  248.       @mode = mode
  249.       refresh
  250.     end
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # ● 设置最先显示的 ID
  254.   #     id : 新的 ID
  255.   #--------------------------------------------------------------------------
  256.   def top_id=(id)
  257.     if @top_id != id
  258.       @top_id = id
  259.       refresh
  260.     end
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 囧方法,取得独立开关的三个数值,我实在懒得去逐个逐个算了……
  264.   #--------------------------------------------------------------------------
  265.   def tvt
  266.     return $game_map.map_id,@top_id + 1,@hash[self.index]
  267.   end
  268. end

  269. #==============================================================================
  270. # ■ Scene_Debug
  271. #------------------------------------------------------------------------------
  272. #  处理调试画面的类。
  273. #==============================================================================

  274. class Scene_Debug < Scene_Base
  275.   #--------------------------------------------------------------------------
  276.   # ● 开始处理
  277.   #--------------------------------------------------------------------------
  278.   def start
  279.     super
  280.     create_menu_background
  281.     @left_window = Window_DebugLeft.new(0, 0)
  282.     @right_window = Window_DebugRight.new(176, 0)
  283.     @help_window = Window_Base.new(176, 272, 368, 144)
  284.     @left_window.top_row = $game_temp.debug_top_row
  285.     @left_window.index = $game_temp.debug_index
  286.     @right_window.mode = @left_window.mode
  287.     @right_window.top_id = @left_window.top_id
  288.     @hash = {0 => "A",1 => "B",2 => "C",3 => "D",4 => "E",5 => "F",6 => "G",7 => "H",8 => "I",9 => "J"}
  289.     @fps_shower = Window_FPS.new
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● 结束处理
  293.   #--------------------------------------------------------------------------
  294.   def terminate
  295.     super
  296.     dispose_menu_background
  297.     $game_map.refresh
  298.     @left_window.dispose
  299.     @right_window.dispose
  300.     @help_window.dispose
  301.     @fps_shower.dispose
  302.     $game_map.need_refresh = true
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ● 更新画面
  306.   #--------------------------------------------------------------------------
  307.   def update
  308.     super
  309.     update_menu_background
  310.     @right_window.mode = @left_window.mode
  311.     @right_window.top_id = @left_window.top_id
  312.     @left_window.update
  313.     @right_window.update
  314.     @fps_shower.update
  315.     $game_temp.debug_top_row = @left_window.top_row
  316.     $game_temp.debug_index = @left_window.index
  317.     if @left_window.active
  318.       update_left_input
  319.     elsif @right_window.active
  320.       update_right_input
  321.     end
  322.    
  323.     if Input.trigger?(Input::SHIFT)
  324.       Sound.play_decision
  325.       file = File.open("Save1.rvdata", "wb")
  326.       write_save_data(file)
  327.       file.close
  328.       wlh = 24
  329.       @help_window.contents.clear
  330.       @help_window.contents.draw_text(4, wlh * 0, 336, wlh, "已保存于一号档。")
  331.     end
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # ● 更新左侧窗口的输入
  335.   #--------------------------------------------------------------------------
  336.   def update_left_input
  337.     if Input.trigger?(Input::B)
  338.       Sound.play_cancel
  339.       $scene = Scene_Map.new
  340.       return
  341.     elsif Input.trigger?(Input::C)
  342.       Sound.play_decision
  343.       wlh = 24
  344.       if @left_window.mode == 0
  345.         text1 = "C (Enter) : ON / OFF"
  346.         @help_window.contents.draw_text(4, 0, 336, wlh, text1)
  347.       elsif @left_window.mode == 1
  348.         text1 = "← (Left)    :  -1"
  349.         text2 = "→ (Right)   :  +1"
  350.         text3 = "L (Pageup)   : -10"
  351.         text4 = "R (Pagedown) : +10"
  352.         @help_window.contents.clear_rect(4, wlh * 0, 336, wlh)
  353.         @help_window.contents.draw_text(4, wlh * 0, 336, wlh, text1)
  354.         @help_window.contents.draw_text(4, wlh * 1, 336, wlh, text2)
  355.         @help_window.contents.draw_text(4, wlh * 2, 336, wlh, text3)
  356.         @help_window.contents.draw_text(4, wlh * 3, 336, wlh, text4)
  357.       else
  358.         text1 = "C (Enter) : ON / OFF"
  359.         @help_window.contents.draw_text(4, 0, 336, wlh, text1)        
  360.       end
  361.       @left_window.active = false
  362.       @right_window.active = true
  363.       @right_window.index = 0
  364.     end
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● 更新右侧窗口的输入
  368.   #--------------------------------------------------------------------------
  369.   def update_right_input
  370.     if Input.trigger?(Input::B)
  371.       Sound.play_cancel
  372.       @left_window.active = true
  373.       @right_window.active = false
  374.       @right_window.index = -1
  375.       @help_window.contents.clear
  376.     else
  377.       current_id = @right_window.top_id + @right_window.index
  378.       if @right_window.mode == 0
  379.         if Input.trigger?(Input::C)
  380.           Sound.play_decision
  381.           $game_switches[current_id] = (not $game_switches[current_id])
  382.           @right_window.refresh
  383.         end
  384.       elsif @right_window.mode == 1
  385.         last_value = $game_variables[current_id]
  386.         if Input.repeat?(Input::RIGHT)
  387.           $game_variables[current_id] += 1
  388.         elsif Input.repeat?(Input::LEFT)
  389.           $game_variables[current_id] -= 1
  390.         elsif Input.repeat?(Input::R)
  391.           $game_variables[current_id] += 10
  392.         elsif Input.repeat?(Input::L)
  393.           $game_variables[current_id] -= 10
  394.         end
  395.         if $game_variables[current_id] > 99999999
  396.           $game_variables[current_id] = 99999999
  397.         elsif $game_variables[current_id] < -99999999
  398.           $game_variables[current_id] = -99999999
  399.         end
  400.         if $game_variables[current_id] != last_value
  401.           Sound.play_cursor
  402.           @right_window.draw_item(@right_window.index)
  403.         end
  404.       elsif @right_window.mode == 2
  405.         if Input.trigger?(Input::C)
  406.           Sound.play_decision
  407.           $game_self_switches[@right_window.tvt] = (not $game_self_switches[@right_window.tvt])         
  408.           @right_window.refresh
  409.         end        
  410.       end
  411.     end
  412.   end
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # ● 写入存档数据
  416.   #     file : 写入文件用对象 (已经打开)
  417.   #--------------------------------------------------------------------------
  418.   def write_save_data(file)
  419.     characters = []
  420.     for actor in $game_party.members
  421.       characters.push([actor.character_name, actor.character_index])
  422.     end
  423.     $game_system.save_count += 1
  424.     $game_system.version_id = $data_system.version_id
  425.     @last_bgm = RPG::BGM::last
  426.     @last_bgs = RPG::BGS::last
  427.     Marshal.dump(characters,           file)
  428.     Marshal.dump(Graphics.frame_count, file)
  429.     Marshal.dump(@last_bgm,            file)
  430.     Marshal.dump(@last_bgs,            file)
  431.     Marshal.dump($game_system,         file)
  432.     Marshal.dump($game_message,        file)
  433.     Marshal.dump($game_switches,       file)
  434.     Marshal.dump($game_variables,      file)
  435.     Marshal.dump($game_self_switches,  file)
  436.     Marshal.dump($game_actors,         file)
  437.     Marshal.dump($game_party,          file)
  438.     Marshal.dump($game_troop,          file)
  439.     Marshal.dump($game_map,            file)
  440.     Marshal.dump($game_player,         file)
  441.   end
  442.   
  443. end
复制代码
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部