Project1

标题: 那啥,我知道伸手讨人嫌,但是无奈没搜到我要找的东西耶 [打印本页]

作者: 咸蛋超人赛斯    时间: 2014-1-20 07:24
标题: 那啥,我知道伸手讨人嫌,但是无奈没搜到我要找的东西耶
本帖最后由 咸蛋超人赛斯 于 2014-1-20 07:35 编辑

是这样的……:
由于游戏里有一整套的人物音效要大换血。原来的音效太矫情我就删掉重录了。
但是这样就会造成【游戏因为找不到某个文件而报错退出】的悲剧呀对伐~~?
所以需要从目前做好的流程中,从头到尾把每个会播放音效的事件都重新赋予一次改版后的音效。
可能很难每个音效都顾及呀对吧~~?
【万一】我回头心血来潮完成了后面的部分屁颠儿屁颠儿地发布了之后……
发现有个不用非得调查的小neta那里要播放的音效没了……导致游戏报错不能玩的话……
气不气人!!!这种事情必须避免!
回想起之前看到某位前辈的签名宣传了一种容错的脚本……
当时没怎么在意,现在貌似找不到了- -
站内搜索呢,搜到一个文件自动跟踪+容错的……
但是我智商下线了不知道那个脚本能不能起到普通容错脚本的作用……
也就是【就算游戏找不到某个文件也能继续运行下去】这种功能……
所以还是没有下载(我真的不是吝啬那120经验- -)
——————————————————————————————————————
所以我想请问一下【XP适用】的【游戏文件容错脚本】怎么找呀~~?前辈们说个地址给个提示或者说一下编写脚本的那位前辈的ID让我自己去找吧~
多谢!
(话说一口一句前辈怎么有种在发“大神贴”的感觉……算了大家知道我不是那个意思就行了嗯……)
作者: 颜LOSE    时间: 2014-1-20 07:28
你来错区了,请去XP技术提问区
作者: 咸蛋超人赛斯    时间: 2014-1-20 07:33
颜LOSE 发表于 2014-1-20 07:28
你来错区了,请去XP技术提问区

抱歉抱歉抱歉…………
作者: 颜LOSE    时间: 2014-1-20 07:38
咸蛋超人赛斯 发表于 2014-1-20 07:33
抱歉抱歉抱歉…………

@protosssonny  
作者: 上贺茂润    时间: 2014-1-20 08:19
楼主到底要什么,看不懂
作者: 咸蛋超人赛斯    时间: 2014-1-20 08:22
上贺茂润 发表于 2014-1-20 08:19
楼主到底要什么,看不懂

容错脚本啊,就算游戏找不到某个文件也能继续运行而不会报错的那种脚本啊,一楼说了呀……
作者: guoyq1988    时间: 2014-1-20 12:45
  1. #==============================================================================
  2. # ■ 容错脚本第3版                                              BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #==============================================================================

  7. $need_file_bitmap = []
  8. if FileTest.exist?("log_bitmap.txt")
  9.   f = File.open("./log_bitmap.txt","r")
  10.   $need_file_bitmap = f.read.split(/\n/)
  11.   f.close
  12. end

  13. module Graphics
  14.   @transition = method("transition")
  15.   def self.transition(*arg)
  16.     begin
  17.       @transition.call(*arg)
  18.     rescue Errno::ENOENT
  19.       ary=[*arg]
  20.       filename=ary[1]
  21.       unless $need_file_bitmap.include?(filename)
  22.         $need_file_bitmap.push(filename)
  23.         f = File.open("./log_bitmap.txt","a")
  24.         f.write(filename + "\n")
  25.         f.close
  26.       end
  27.       @transition.call(ary[0])
  28.     end
  29.   end
  30. end

  31. class Bitmap < Object
  32.   alias ini initialize
  33.   def initialize(*arg)
  34.     begin
  35.       ini(*arg)
  36.     rescue Errno::ENOENT
  37.       filename=[*arg][0]
  38.       unless $need_file_bitmap.include?(filename)
  39.         $need_file_bitmap.push(filename)
  40.         f = File.open("./log_bitmap.txt","a")
  41.         f.write(filename + "\n")
  42.         f.close
  43.       end
  44.       ini(32,32)
  45.     end
  46.   end
  47. end

  48. $need_file_audio = []
  49. if FileTest.exist?("log_audio.txt")
  50.   f = File.open("./log_audio.txt","r")
  51.   $need_file_audio = f.read.split(/\n/)
  52.   f.close
  53. end

  54. module Audio
  55.   @me_play = method("me_play")
  56.   def self.me_play(*arg)
  57.     begin
  58.       @me_play.call(*arg)
  59.     rescue Errno::ENOENT
  60.       filename=[*arg][0]
  61.       unless $need_file_audio.include?(filename)
  62.         $need_file_audio.push(filename)
  63.         f = File.open("./log_audio.txt","a")
  64.         f.write(filename + "\n")
  65.         f.close
  66.       end
  67.       me_stop
  68.     end
  69.   end
  70.   @bgm_play = method("bgm_play")
  71.   def self.bgm_play(*arg)
  72.     begin
  73.       @bgm_play.call(*arg)
  74.     rescue Errno::ENOENT
  75.       filename=[*arg][0]
  76.       unless $need_file_audio.include?(filename)
  77.         $need_file_audio.push(filename)
  78.         f = File.open("./log_audio.txt","a")
  79.         f.write(filename + "\n")
  80.         f.close
  81.       end
  82.       bgm_stop
  83.     end
  84.   end
  85.   @se_play = method("se_play")
  86.   def self.se_play(*arg)
  87.     begin
  88.       @se_play.call(*arg)
  89.     rescue Errno::ENOENT
  90.       filename=[*arg][0]
  91.       unless $need_file_audio.include?(filename)
  92.         $need_file_audio.push(filename)
  93.         f = File.open("./log_audio.txt","a")
  94.         f.write(filename + "\n")
  95.         f.close
  96.       end
  97.       se_stop
  98.     end
  99.   end
  100.   @bgs_play = method("bgs_play")
  101.   def self.bgs_play(*arg)
  102.     begin
  103.       @bgs_play.call(*arg)
  104.     rescue Errno::ENOENT
  105.       filename=[*arg][0]
  106.       unless $need_file_audio.include?(filename)
  107.         $need_file_audio.push(filename)
  108.         f = File.open("./log_audio.txt","a")
  109.         f.write(filename + "\n")
  110.         f.close
  111.       end
  112.       bgs_stop
  113.     end
  114.   end
  115. end
复制代码
是这个么?
作者: 咸蛋超人赛斯    时间: 2014-1-20 12:57
guoyq1988 发表于 2014-1-20 12:45
是这个么?

是的是的~~非常感谢!




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1