Project1
标题:
怎么做空白……
[打印本页]
作者:
54cn
时间:
2010-8-7 12:58
标题:
怎么做空白……
有些素材被当成病毒给删了,有没有:
如果找不到素材就用空白素材代替的脚本
急……………………
作者:
幻の飞鱼
时间:
2010-8-7 13:04
MS有个跳过错误的脚本,但是……现在的主站MS还没修复,搞半天没找到
作者:
liqunsz
时间:
2010-8-7 13:12
容错脚本第2版
#==============================================================================
# ■ 容错脚本第2版 BY 亿万星辰
#------------------------------------------------------------------------------
# 道理很简单,缺什么就不用什么……全缺的话会比较恐怖,比如默认的范例就是……
# 不过这里要声明的一点,这个只针对素材的缺失,如果data文件夹下的数据缺失的话,
# 这样再用容错似乎没什么意义…… (数据库都没了还容什么错……)
#
# 下一版本考虑增加一些替代用的素材。
#
# 默认范例为新建工程时生成的默认地图……只是RTP没选而已。
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 演奏 BGM
# bgm : 演奏的 BGM
#--------------------------------------------------------------------------
def bgm_play(bgm)
@playing_bgm = bgm
begin
if bgm != nil and bgm.name != ""
Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)
else
Audio.bgm_stop
end
rescue Errno::ENOENT
Audio.bgm_stop
unless $need_file.include?("Audio/BGM/#{bgm.name}")
$need_file.push("Audio/BGM/#{bgm.name}")
f = File.open("./log.txt","a")
f.write("Audio/BGM/#{bgm.name}" + "\n")
f.close
end
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# ● 演奏 BGS
# bgs : 演奏的 BGS
#--------------------------------------------------------------------------
def bgs_play(bgs)
@playing_bgs = bgs
begin
if bgs != nil and bgs.name != ""
Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume, bgs.pitch)
else
Audio.bgs_stop
end
rescue Errno::ENOENT
Audio.bgs_stop
unless $need_file.include?("Audio/BGM/#{bgs.name}")
$need_file.push("Audio/BGM/#{bgs.name}")
f = File.open("./log.txt","a")
f.write("Audio/BGM/#{bgs.name}" + "\n")
f.close
end
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# ● ME 的演奏
# me : 演奏的 ME
#--------------------------------------------------------------------------
def me_play(me)
begin
if me != nil and me.name != ""
Audio.me_play("Audio/ME/" + me.name, me.volume, me.pitch)
else
Audio.me_stop
end
rescue Errno::ENOENT
Audio.me_stop
unless $need_file.include?("Audio/BGM/#{me.name}")
$need_file.push("Audio/BGM/#{me.name}")
f = File.open("./log.txt","a")
f.write("Audio/BGM/#{me.name}" + "\n")
f.close
end
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# ● SE 的演奏
# se : 演奏的 SE
#--------------------------------------------------------------------------
def se_play(se)
begin
if se != nil and se.name != ""
Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
end
rescue Errno::ENOENT
Audio.se_stop
unless $need_file.include?("Audio/BGM/#{se.name}")
$need_file.push("Audio/BGM/#{se.name}")
f = File.open("./log.txt","a")
f.write("Audio/BGM/#{se.name}" + "\n")
f.close
end
end
end
end
module RPG
module Cache
def self.load_bitmap(folder_name, filename, hue = 0)
begin
path = folder_name + filename
if not @cache.include?(path) or @cache[path].disposed?
if filename != ""
@cache[path] = Bitmap.new(path)
else
@cache[path] = Bitmap.new(32, 32)
end
end
if hue == 0
@cache[path]
else
key = [path, hue]
if not @cache.include?(key) or @cache[key].disposed?
@cache[key] = @cache[path].clone
@cache[key].hue_change(hue)
end
@cache[key]
end
rescue Errno::ENOENT
unless $need_file.include?("#{folder_name}#{filename}")
$need_file.push("#{folder_name}#{filename}")
f = File.open("./log.txt","a")
f.write("#{folder_name}#{filename}" + "\n")
f.close
end
self.load_bitmap(folder_name, "", hue)
end
end
end
end
复制代码
容错脚本第3版
#==============================================================================
# ■ 容错脚本第3版 BY 轮回者
#------------------------------------------------------------------------------
# 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
# 说明请参看星大叔的容错脚本第2版。
#==============================================================================
$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
end
@transition.call(ary[0])
end
end
end
class Bitmap < Object
alias ini initialize
def initialize(*arg)
begin
ini(*arg)
rescue Errno::ENOENT
filename=[*arg][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
end
ini(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
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
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
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
end
bgs_stop
end
end
end
复制代码
作者:
小幽的马甲
时间:
2010-8-7 13:17
= =LS抢先了,当我没说
作者:
tree52
时间:
2010-8-7 13:27
如果只是极个别素材是病毒被删的话,就在相应文件夹下新建一个空白文件如txt文本文档,然后把该文件名与后缀名一同改为原文件名。随口说说咯,呵呵~
作者:
猫猫~
时间:
2010-8-7 15:43
如果是这样的话~\(≧▽≦)/~给你个第三版
#==============================================================================
# ■ 容错脚本第3版 BY 轮回者
#------------------------------------------------------------------------------
# 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
# 说明请参看星大叔的容错脚本第2版。
#==============================================================================
$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
end
@transition.call(ary[0])
end
end
end
class Bitmap < Object
alias ini initialize
def initialize(*arg)
begin
ini(*arg)
rescue Errno::ENOENT
filename=[*arg][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
end
ini(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
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
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
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
end
bgs_stop
end
end
end
复制代码
去吧Graphics删了吧~\(≧▽≦)/~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1