查看: 2803|回复: 4

[已经解决] 有跳过缺失素材并且生成TXT目录的脚本吗

[复制链接]
梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
回帖
76
发表于 2017-8-18 18:33:14 | 显示全部楼层 |阅读模式

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

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

×
之前我找到一个,竟然删掉了,话说这个功能超级好用啊,测试游戏必备
有谁能发一个吗,谢谢!

点评

http://rm.66rpg.com/forum.php?mod=viewthread&tid=249998 善用搜索:容错脚本  发表于 2017-8-18 18:58
已经在做游戏了~~~愉悦的做游戏体验
梦石
0
星屑
19426
在线时间
3082 小时
注册时间
2013-1-11
回帖
1207
发表于 2017-8-18 18:57:41 | 显示全部楼层
[pre lang="ruby"]#==============================================================================
# ■ 容错脚本第3版(070816修订)                                   BY 轮回者
#------------------------------------------------------------------------------
#  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
#  说明请参看星大叔的容错脚本第2版。
#------------------------------------------------------------------------------
#  07.08.16
#     修正了按下F12重启后的错误
#     附,出错原因:重启后RMXP封装的类没有重置
#==============================================================================

$丢失提示 = true #丢失文件后是否信息框提示

begin
  result = Graphics::Transition.nil?
rescue
  result = true
end

if result
  
  $need_file_bitmap = []
  if FileTest.exist?("log_bitmap.txt")
    f = File.open("./log_bitmap.txt","r")
    $need_file_bitmap = f.read.split(/\n/)
    f.close
  end

  module Graphics
    Transition = method("transition")
    def self.transition(*arg)
      begin
        Transition.call(*arg)
      rescue Errno::ENOENT
        ary=[*arg]
        filename=ary[1]
        unless $need_file_bitmap.include?(filename)
          $need_file_bitmap.push(filename)
          f = File.open("./log_bitmap.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
        end
        Transition.call(ary[0])
      end
    end
  end

  class Bitmap < Object
    alias ini_Fx initialize
     
    def initialize(*args)
      begin
        ini_Fx(*args)
        return
      rescue Errno::ENOENT
        filename=[*args][0]
        unless $need_file_bitmap.include?(filename)
          $need_file_bitmap.push(filename)
          f = File.open("./log_bitmap.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
        end
        ini_Fx(32,32)
      end
    end
  end

  $need_file_audio = []
  if FileTest.exist?("log_audio.txt")
    f = File.open("./log_audio.txt","r")
    $need_file_audio = f.read.split(/\n/)
    f.close
  end
  
  module Audio
    Me_play = method("me_play")
    def self.me_play(*arg)
      begin
        Me_play.call(*arg)
      rescue Errno::ENOENT
        filename=[*arg][0]
        unless $need_file_audio.include?(filename)
          $need_file_audio.push(filename)
          f = File.open("./log_audio.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有ME文件(#{filename})丢失了..." if $丢失提示
        end
        me_stop
      end
    end
    Bgm_play = method("bgm_play")
    def self.bgm_play(*arg)
      begin
        Bgm_play.call(*arg)
      rescue Errno::ENOENT
        filename=[*arg][0]
        unless $need_file_audio.include?(filename)
          $need_file_audio.push(filename)
          f = File.open("./log_audio.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有BGM文件(#{filename})丢失了..." if $丢失提示
        end
        bgm_stop
      end
    end
    Se_play = method("se_play")
    def self.se_play(*arg)
      begin
        Se_play.call(*arg)
      rescue Errno::ENOENT
        filename=[*arg][0]
        unless $need_file_audio.include?(filename)
          $need_file_audio.push(filename)
          f = File.open("./log_audio.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有SE文件(#{filename})丢失了..." if $丢失提示
        end
        se_stop
      end
    end
    Bgs_play = method("bgs_play")
    def self.bgs_play(*arg)
      begin
        Bgs_play.call(*arg)
      rescue Errno::ENOENT
        filename=[*arg][0]
        unless $need_file_audio.include?(filename)
          $need_file_audio.push(filename)
          f = File.open("./log_audio.txt","a")
          f.write(filename + "\n")
          f.close
          msgbox "弱弱的提示一下,您有BGS文件(#{filename})丢失了..." if $丢失提示
        end
        bgs_stop
      end
    end
  end
end
[/pre]

点评

十分感谢!!  发表于 2017-8-20 22:51
回复 2 0

使用道具 举报

梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
回帖
76
 楼主| 发表于 2017-8-19 13:22:43 | 显示全部楼层
本帖最后由 Nil2011 于 2017-8-19 13:26 编辑
张咚咚 发表于 2017-8-18 18:57
#==============================================================================
# ■ 容错脚本第3版( ...


十分感谢!!!!
为什么我点击评分,认可答案,打不了数值。。没办法认可啊
已经在做游戏了~~~愉悦的做游戏体验
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部