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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
帖子
16
跳转到指定楼层
1
发表于 2015-6-24 06:51:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

(。・∀・)ノ゙我又来求脚本了。。。o(╯□╰)o
已经在论坛搜过,只找到一个这个 https://rpg.blue/forum.php?mod=viewthread&tid=235912
但是不知道为啥有时候会出现 266-271行
RUBY 代码复制
  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


所以问问还有没有其他类似的脚本 日文的也行 自己尝试汉化下 吼吼~

Lv1.梦旅人

梦石
0
星屑
76
在线时间
1379 小时
注册时间
2012-7-5
帖子
1698

开拓者

2
发表于 2015-6-24 09:07:18 | 只看该作者
我运行了一下完全没问题

  -fk: -azogi:
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
82
在线时间
26 小时
注册时间
2010-12-3
帖子
16
3
 楼主| 发表于 2015-6-24 11:22:49 | 只看该作者
kuerlulu 发表于 2015-6-24 09:07
我运行了一下完全没问题

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

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
90
在线时间
357 小时
注册时间
2006-3-3
帖子
181
4
发表于 2015-6-24 16:30:06 | 只看该作者
RUBY 代码复制
  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. #==============================================================================
  53. # ■ Window_FPS
  54. #------------------------------------------------------------------------------
  55. #  伪·FPS计算窗
  56. #==============================================================================
  57. class Window_FPS < Window_Base
  58.   def initialize
  59.     super(424,366,120,50)
  60.     @time = Time.now
  61.     @fs = 0
  62.     @fps = 60
  63.     refresh
  64.   end
  65.   def update
  66.     @fs += 1
  67.     nt = Time.now
  68.     tc = (nt - @time)
  69.     if tc >= 1
  70.       @fps = @fs
  71.       @fs = 0
  72.       @time = nt
  73.       refresh
  74.     end
  75.   end
  76.   def refresh
  77.     self.contents.clear
  78.     self.contents.draw_text(self.contents.rect,"伪FPS:" + @fps.to_s)
  79.   end
  80. end
  81.  
  82. #==============================================================================
  83. # ■ Window_DebugLeft
  84. #------------------------------------------------------------------------------
  85. #  调试画面、指定开关及变量块的窗口。
  86. #==============================================================================
  87.  
  88. class Window_DebugLeft < Window_Selectable
  89.   #--------------------------------------------------------------------------
  90.   # ● 初始化对象
  91.   #     x     : 窗口的 X 坐标
  92.   #     y     : 窗口的 Y 坐标
  93.   #--------------------------------------------------------------------------
  94.   def initialize(x, y)
  95.     super(x, y, 176, 416)
  96.     self.index = 0
  97.     refresh
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # ● 刷新
  101.   #--------------------------------------------------------------------------
  102.   def refresh
  103.     @switch_max = ($data_system.switches.size - 1 + 9) / 10
  104.     @variable_max = ($data_system.variables.size - 1 + 9) / 10
  105.     @item_max = @switch_max + @variable_max + $game_map.events.values.size
  106.     create_contents
  107.     for i in 0...@item_max
  108.       draw_item(i)
  109.     end
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # ● 描绘项目
  113.   #     index : 项目编号
  114.   #--------------------------------------------------------------------------
  115.   def draw_item(index)
  116.     if index < @switch_max
  117.       n = index * 10
  118.       text = sprintf("S [%04d-%04d]", n+1, n+10)
  119.     elsif index < @variable_max + @switch_max
  120.       n = (index - @switch_max) * 10
  121.       text = sprintf("V [%04d-%04d]", n+1, n+10)
  122.     else
  123.       n = (index - @switch_max - @variable_max)
  124.       text = "E " + $game_map.events.values[n].event.name
  125.     end
  126.     rect = item_rect(index)
  127.     rect.x += 4
  128.     rect.width -= 8
  129.     self.contents.clear_rect(rect)
  130.     self.contents.draw_text(rect, text)
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 获取模式
  134.   #--------------------------------------------------------------------------
  135.   def mode
  136.     if self.index < @switch_max
  137.       return 0
  138.     elsif self.index < @switch_max + @variable_max
  139.       return 1
  140.     else
  141.       return 2
  142.     end
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 获取开头显示部分的 ID
  146.   #--------------------------------------------------------------------------
  147.   def top_id
  148.     if self.index < @switch_max
  149.       return self.index * 10 + 1
  150.     elsif self.index < @switch_max + @variable_max
  151.       return (self.index - @switch_max) * 10 + 1
  152.     else
  153.       return self.index - @switch_max - @variable_max
  154.     end
  155.   end
  156. end
  157.  
  158. #==============================================================================
  159. # ■ Window_DebugRight
  160. #------------------------------------------------------------------------------
  161. #  调试画面、单独显示开关以及变量的窗口。
  162. #==============================================================================
  163.  
  164. class Window_DebugRight < Window_Selectable
  165.   #--------------------------------------------------------------------------
  166.   # ● 定义实例变量
  167.   #--------------------------------------------------------------------------
  168.   attr_reader   :mode                     # 模式 (0:开关、1:变量)
  169.   attr_reader   :top_id                   # 最前显示部分的 ID
  170.   #--------------------------------------------------------------------------
  171.   # ● 初始化对象
  172.   #     x : 窗口的 X 坐标
  173.   #     y : 窗口的 Y 坐标
  174.   #--------------------------------------------------------------------------
  175.   def initialize(x, y)
  176.     super(x, y, 368, 10 * WLH + 32)
  177.     self.index = -1
  178.     self.active = false
  179.     @item_max = 10
  180.     @mode = 0
  181.     @top_id = 1
  182.     @hash = {0 => "A",1 => "B",2 => "C",3 => "D",4 => "E",5 => "F",6 => "G",7 => "H",8 => "I",9 => "J"}
  183.     refresh
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ● 刷新
  187.   #--------------------------------------------------------------------------
  188.   def refresh
  189.     self.contents.clear
  190.     for i in 0...@item_max
  191.       draw_item(i)
  192.     end
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 描绘项目
  196.   #     index   : 项目编号
  197.   #--------------------------------------------------------------------------
  198.   def draw_item(index)
  199.     current_id = @top_id + index
  200.     id_text = sprintf("%04d:", current_id)
  201.     if @mode == 2
  202.       id_text = ""
  203.     end
  204.     id_width = self.contents.text_size(id_text).width
  205.     ############################################
  206.     color = false
  207.     ############################################
  208.     if @mode == 0
  209.       name = $data_system.switches[current_id]
  210.       status = $game_switches[current_id] ? "[ON]" : "[OFF]"
  211.     elsif @mode == 1
  212.       name = $data_system.variables[current_id]
  213.       status = $game_variables[current_id]
  214.     else
  215.       name = "独立开关" + @hash[index].to_s
  216.       status = $game_self_switches[[$game_map.map_id,@top_id + 1,@hash[index]]]
  217.       if status.is_a?(TrueClass) or status.is_a?(FalseClass)
  218.         status = status ? "[ON]" : "[OFF]"
  219.       else
  220.         unless status == NULLSTR
  221.           ############
  222.           color = true
  223.           ############
  224.           status = "[" + status.type.to_s + ":" + status.inspect + "]"
  225.         end
  226.       end
  227.     end
  228.     if name == nil
  229.       name = ""
  230.     end
  231.     rect = item_rect(index)
  232.     rect.x += 4
  233.     rect.width -= 8
  234.     self.contents.clear_rect(rect)
  235.     if color == false
  236.       self.contents.font.color = normal_color
  237.     else
  238.       self.contents.font.color = system_color
  239.     end
  240.     self.contents.draw_text(rect, id_text)
  241.     rect.x += id_width
  242.     rect.width -= id_width + 60
  243.     self.contents.draw_text(rect, name)
  244.     rect.width += 60
  245.     self.contents.draw_text(rect, status, 2)
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● 设置模式
  249.   #     id : 新模式
  250.   #--------------------------------------------------------------------------
  251.   def mode=(mode)
  252.     if @mode != mode
  253.       @mode = mode
  254.       refresh
  255.     end
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 设置最先显示的 ID
  259.   #     id : 新的 ID
  260.   #--------------------------------------------------------------------------
  261.   def top_id=(id)
  262.     if @top_id != id
  263.       @top_id = id
  264.       refresh
  265.     end
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● 囧方法,取得独立开关的三个数值,我实在懒得去逐个逐个算了……
  269.   #--------------------------------------------------------------------------
  270.   def tvt
  271.     return $game_map.map_id,@top_id + 1,@hash[self.index]
  272.   end
  273. end
  274.  
  275. #==============================================================================
  276. # ■ Scene_Debug
  277. #------------------------------------------------------------------------------
  278. #  处理调试画面的类。
  279. #==============================================================================
  280.  
  281. class Scene_Debug < Scene_Base
  282.   #--------------------------------------------------------------------------
  283.   # ● 开始处理
  284.   #--------------------------------------------------------------------------
  285.   def start
  286.     super
  287.     create_menu_background
  288.     @left_window = Window_DebugLeft.new(0, 0)
  289.     @right_window = Window_DebugRight.new(176, 0)
  290.     @help_window = Window_Base.new(176, 272, 368, 144)
  291.     @left_window.top_row = $game_temp.debug_top_row
  292.     @left_window.index = $game_temp.debug_index
  293.     @right_window.mode = @left_window.mode
  294.     @right_window.top_id = @left_window.top_id
  295.     @hash = {0 => "A",1 => "B",2 => "C",3 => "D",4 => "E",5 => "F",6 => "G",7 => "H",8 => "I",9 => "J"}
  296.     @fps_shower = Window_FPS.new
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 结束处理
  300.   #--------------------------------------------------------------------------
  301.   def terminate
  302.     super
  303.     dispose_menu_background
  304.     $game_map.refresh
  305.     @left_window.dispose
  306.     @right_window.dispose
  307.     @help_window.dispose
  308.     @fps_shower.dispose
  309.     $game_map.need_refresh = true
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # ● 更新画面
  313.   #--------------------------------------------------------------------------
  314.   def update
  315.     super
  316.     update_menu_background
  317.     @right_window.mode = @left_window.mode
  318.     @right_window.top_id = @left_window.top_id
  319.     @left_window.update
  320.     @right_window.update
  321.     @fps_shower.update
  322.     $game_temp.debug_top_row = @left_window.top_row
  323.     $game_temp.debug_index = @left_window.index
  324.     if @left_window.active
  325.       update_left_input
  326.     elsif @right_window.active
  327.       update_right_input
  328.     end
  329.  
  330.     if Input.trigger?(Input::SHIFT)
  331.       Sound.play_decision
  332.       file = File.open("Save1.rvdata", "wb")
  333.       write_save_data(file)
  334.       file.close
  335.       wlh = 24
  336.       @help_window.contents.clear
  337.       @help_window.contents.draw_text(4, wlh * 0, 336, wlh, "已保存于一号档。")
  338.     end
  339.   end
  340.   #--------------------------------------------------------------------------
  341.   # ● 更新左侧窗口的输入
  342.   #--------------------------------------------------------------------------
  343.   def update_left_input
  344.     if Input.trigger?(Input::B)
  345.       Sound.play_cancel
  346.       $scene = Scene_Map.new
  347.       return
  348.     elsif Input.trigger?(Input::C)
  349.       Sound.play_decision
  350.       wlh = 24
  351.       if @left_window.mode == 0
  352.         text1 = "C (Enter) : ON / OFF"
  353.         @help_window.contents.draw_text(4, 0, 336, wlh, text1)
  354.       elsif @left_window.mode == 1
  355.         text1 = "← (Left)    :  -1"
  356.         text2 = "→ (Right)   :  +1"
  357.         text3 = "L (Pageup)   : -10"
  358.         text4 = "R (Pagedown) : +10"
  359.         @help_window.contents.clear_rect(4, wlh * 0, 336, wlh)
  360.         @help_window.contents.draw_text(4, wlh * 0, 336, wlh, text1)
  361.         @help_window.contents.draw_text(4, wlh * 1, 336, wlh, text2)
  362.         @help_window.contents.draw_text(4, wlh * 2, 336, wlh, text3)
  363.         @help_window.contents.draw_text(4, wlh * 3, 336, wlh, text4)
  364.       else
  365.         text1 = "C (Enter) : ON / OFF"
  366.         @help_window.contents.draw_text(4, 0, 336, wlh, text1)        
  367.       end
  368.       @left_window.active = false
  369.       @right_window.active = true
  370.       @right_window.index = 0
  371.     end
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 更新右侧窗口的输入
  375.   #--------------------------------------------------------------------------
  376.   def update_right_input
  377.     if Input.trigger?(Input::B)
  378.       Sound.play_cancel
  379.       @left_window.active = true
  380.       @right_window.active = false
  381.       @right_window.index = -1
  382.       @help_window.contents.clear
  383.     else
  384.       current_id = @right_window.top_id + @right_window.index
  385.       if @right_window.mode == 0
  386.         if Input.trigger?(Input::C)
  387.           Sound.play_decision
  388.           $game_switches[current_id] = (not $game_switches[current_id])
  389.           @right_window.refresh
  390.         end
  391.       elsif @right_window.mode == 1
  392.         last_value = $game_variables[current_id]
  393.         if Input.repeat?(Input::RIGHT)
  394.           $game_variables[current_id] += 1
  395.         elsif Input.repeat?(Input::LEFT)
  396.           $game_variables[current_id] -= 1
  397.         elsif Input.repeat?(Input::R)
  398.           $game_variables[current_id] += 10
  399.         elsif Input.repeat?(Input::L)
  400.           $game_variables[current_id] -= 10
  401.         end
  402.         if $game_variables[current_id] > 99999999
  403.           $game_variables[current_id] = 99999999
  404.         elsif $game_variables[current_id] < -99999999
  405.           $game_variables[current_id] = -99999999
  406.         end
  407.         if $game_variables[current_id] != last_value
  408.           Sound.play_cursor
  409.           @right_window.draw_item(@right_window.index)
  410.         end
  411.       elsif @right_window.mode == 2
  412.         if Input.trigger?(Input::C)
  413.           Sound.play_decision
  414.           $game_self_switches[@right_window.tvt] = (not $game_self_switches[@right_window.tvt])         
  415.           @right_window.refresh
  416.         end        
  417.       end
  418.     end
  419.   end
  420.  
  421.   #--------------------------------------------------------------------------
  422.   # ● 写入存档数据
  423.   #     file : 写入文件用对象 (已经打开)
  424.   #--------------------------------------------------------------------------
  425.   def write_save_data(file)
  426.     characters = []
  427.     for actor in $game_party.members
  428.       characters.push([actor.character_name, actor.character_index])
  429.     end
  430.     $game_system.save_count += 1
  431.     $game_system.version_id = $data_system.version_id
  432.     @last_bgm = RPG::BGM::last
  433.     @last_bgs = RPG::BGS::last
  434.     Marshal.dump(characters,           file)
  435.     Marshal.dump(Graphics.frame_count, file)
  436.     Marshal.dump(@last_bgm,            file)
  437.     Marshal.dump(@last_bgs,            file)
  438.     Marshal.dump($game_system,         file)
  439.     Marshal.dump($game_message,        file)
  440.     Marshal.dump($game_switches,       file)
  441.     Marshal.dump($game_variables,      file)
  442.     Marshal.dump($game_self_switches,  file)
  443.     Marshal.dump($game_actors,         file)
  444.     Marshal.dump($game_party,          file)
  445.     Marshal.dump($game_troop,          file)
  446.     Marshal.dump($game_map,            file)
  447.     Marshal.dump($game_player,         file)
  448.   end
  449.  
  450. end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-5 21:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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