赞 | 76 |
VIP | 0 |
好人卡 | 0 |
积分 | 97 |
经验 | 554 |
最后登录 | 2025-1-5 |
在线时间 | 572 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9707
- 在线时间
- 572 小时
- 注册时间
- 2017-9-28
- 帖子
- 209
|
可以在 Main 前添加下面的脚本,打开显示控制台并进游戏触发一下报错,出错的时候报错信息和相关的事件位置会显示在控制台里
- # coding: utf-8
- #==============================================================================
- # FullError.rb
- #==============================================================================
- # @plugindesc Show full backtrace when error occurs.
- # @author hyrious
- #
- # @help This plugin does not provide plugin commands.
- # @mod rgss_main
- alias _full_error_rgss_main rgss_main
- def rgss_main(*args, &blk)
- _full_error_rgss_main(*args, &blk)
- rescue Exception => e
- puts "#{e.class}: #{e.message}"
- e.backtrace.each do |c|
- break if c.start_with?(':1:')
- if parts = c.match(/^(?<file>.+):(?<line>\d+)(?::in `(?<code>.*)')?$/)
- next if parts[:file] == __FILE__
- cd = Regexp.escape(File.join(Dir.getwd, ''))
- file = parts[:file].sub(/^#{cd}/, '')
- if inner = file.match(/^\{(?<rgss>\d+)\}$/)
- id = inner[:rgss].to_i
- file = "[#{$RGSS_SCRIPTS[id][1]}]"
- end
- code = parts[:code] && ": #{parts[:code]}"
- puts " #{file} #{parts[:line]}#{code}"
- else
- puts " #{c}"
- end
- end
- rgss_stop
- end
- class Game_Interpreter
- # @mod Game_Interpreter#command_355
- alias _full_error_command_355 command_355
- def command_355
- begin
- _full_error_command_355
- rescue Exception => e
- event = get_character(0)
- name = event.instance_variable_get(:@event).name
- print "at map #@map_id #{$game_map.display_name}"
- puts ", event #@event_id #{name} (#{event.x}, #{event.y})"
- raise
- ensure
- [email protected] if $@
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|