11-15-2012, 02:57 PM
Yes, this:
i have no idea how to use this script, and the person who sent it to me hasn't responded. it's supposed to log all the resources used in order to help keep the filesize down.
Content Hidden
Code:
module RPG module Cache
Graphic_Log_Filename = "Used_Graphics.txt"
def self.load_bitmap(folder_name, filename, hue = 0)
path = folder_name + filename
if not @cache.include?(path) or @cache[path].disposed?
if filename != ""
@cache[path] = Bitmap.new(path)
File.open(Graphic_Log_Filename, 'a') {|f| f.write(path + "\n") }
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
end
end
end
class Game_System
Sound_Log_Filename = "Used_Sounds.txt"
#--------------------------------------------------------------------------
# * Play Background Music
# bgm : background music to be played
#--------------------------------------------------------------------------
def bgm_play(bgm)
@playing_bgm = bgm
if bgm != nil and bgm.name != ""
Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)
File.open(Sound_Log_Filename, 'a') {|f| f.write(bgm.name + "\n") }
else
Audio.bgm_stop
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# * Play Background Sound
# bgs : background sound to be played
#--------------------------------------------------------------------------
def bgs_play(bgs)
@playing_bgs = bgs
if bgs != nil and bgs.name != ""
Audio.bgs_play("Audio/BGS/" + bgs.name, bgs.volume, bgs.pitch)
File.open(Sound_Log_Filename, 'a') {|f| f.write(bgs.name + "\n") }
else
Audio.bgs_stop
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# * Play Music Effect
# me : music effect to be played
#--------------------------------------------------------------------------
def me_play(me)
if me != nil and me.name != ""
Audio.me_play("Audio/ME/" + me.name, me.volume, me.pitch)
File.open(Sound_Log_Filename, 'a') {|f| f.write(me.name + "\n") }
else
Audio.me_stop
end
Graphics.frame_reset
end
#--------------------------------------------------------------------------
# * Play Sound Effect
# se : sound effect to be played
#--------------------------------------------------------------------------
def se_play(se)
if se != nil and se.name != ""
Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
File.open(Sound_Log_Filename, 'a') {|f| f.write(se.name + "\n") }
end
end
end
i have no idea how to use this script, and the person who sent it to me hasn't responded. it's supposed to log all the resources used in order to help keep the filesize down.