赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 12 |
经验 | 1937 |
最后登录 | 2012-6-16 |
在线时间 | 274 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1165
- 在线时间
- 274 小时
- 注册时间
- 2011-7-24
- 帖子
- 272
|
脚本:.......- #===============================================================
- # ● [XP/VX] ◦ 'FILE MISSING ERROR' PREVENTER ◦ □
- # * Game won't quit because file missing error anymore~ *
- #--------------------------------------------------------------
- # ◦ by Woratana [[email protected]]
- # ◦ Thaiware RPG Maker Community
- # ◦ Released on: 05/10/2008
- # ◦ Version: 1.0
- #--------------------------------------------------------------
- # * Put this script over everything in your game!
- # (Default scripts in Script Editor are not an exception!)
- #------------------------------------------------------------------
- module Wora_FMEP
- #========================================================
- # * [START] 'FILE MISSING ERROR' PREVENTER SETUP PART *
- #--------------------------------------------------------
- Print_Missing_File = true
- # Print Missing File when error occured
-
- Record_Missing_File = true
- # Record missing file to missing file log?
- Missing_Log_File_Name = 'missing_log.txt'
- # Name of file to store missing file names list
-
- Use_Audio_Replacement = false
- # Use replacement audio file for missing audio?
- Audio_Replacement_File = 'Audio/SE/Buzzer1'
- # Audio file that will play for miassing audio
-
- Use_Bitmap_Replacement = false
- # Use replacement image file for missing image?
- Bitmap_Replacement_File = 'Graphics/Pictures/Filler'
- # Image file that will use for missing image
- #--------------------------------------------------------
- # * [END] 'FILE MISSING ERROR' PREVENTER SETUP PART *
- #========================================================
-
- def self.print(type, name)
- if Print_Missing_File
- p 'Missed File: ' + name.to_s
- end
- if Record_Missing_File
- file = File.open(Missing_Log_File_Name, "a+")
- type = type == 0 ? 'Bitmap' : 'Audio'
- text = '*' + type.to_s + '* :' + name.to_s + "\n"
- file.write(text) unless file.readlines.include?(text)
- file.close
- end
- end
- end
- class << Audio
- AUDME = [:bgm_play, :bgs_play, :me_play, :se_play]
- AUDME.each do |method|
- new_method = 'wora_fmep_aud_' + method.to_s
- alias_method(new_method, method) unless $@
- new_def = <<_ALIAS_
- def #{method}(*args)
- begin
- #{new_method}(*args)
- rescue
- Wora_FMEP.print(1, args[0])
- #{new_method}(Wora_FMEP::Audio_Replacement_File, args[1], args[2]) if
- Wora_FMEP::Use_Audio_Replacement
- end
- end
- _ALIAS_
- eval(new_def)
- end
- end
- class Bitmap
- unless $@
- alias wora_fmep_bmp_ini initialize
- def initialize(*args)
- begin
- wora_fmep_bmp_ini(*args)
- rescue
- Wora_FMEP.print(0, args[0])
- if Wora_FMEP::Use_Bitmap_Replacement
- wora_fmep_bmp_ini(Wora_FMEP::Bitmap_Replacement_File)
- else
- wora_fmep_bmp_ini(32, 32)
- end
- end
- end
- end
- end
复制代码 |
|