Project1
标题:
可不可以设置找不到音乐文件也可以运行的方法?
[打印本页]
作者:
bafsdaas
时间:
2011-9-10 11:02
提示:
作者被禁止或删除 内容自动屏蔽
作者:
pkboy9999
时间:
2011-9-10 12:26
把F9的数据库里面所有音效改成无
作者:
bafsdaas
时间:
2011-9-10 12:47
提示:
作者被禁止或删除 内容自动屏蔽
作者:
fux2
时间:
2011-9-10 13:05
main整个用loop套起来,然后rescue不处理。
作者:
亿万星辰
时间:
2011-9-10 14:33
容错脚本
作者:
zhengxinwu
时间:
2011-9-10 17:49
找不到 就随便安一个取名叫GAME OVER的音乐
不就行了
作者:
昔日辉煌灬
时间:
2011-9-12 19:05
脚本:.......
#===============================================================
# ● [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
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1