赞 | 0 |
VIP | 130 |
好人卡 | 11 |
积分 | 4 |
经验 | 42041 |
最后登录 | 2023-6-3 |
在线时间 | 2024 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 400
- 在线时间
- 2024 小时
- 注册时间
- 2011-7-20
- 帖子
- 488
|
本帖最后由 「旅」 于 2012-4-3 10:04 编辑
可以试试这个素材提取器。使用时把它插入到脚本编辑器,RMXP = "C:/RPG Maker XP/RGSS/Standard/" 将此改成自己的RPG Maker XP的地址。
另外当时我试过的不是这个,是柳柳的。但现在却下不到,您先试试把。
#============================================================================ # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息,使用……只能用一次 # 核心作者:RoyRoy # 修正:kaien # 使用方法: # 1、首先输入RMXP的标准素材库地址,下面给出的是默认地址 # 2、运行脚本就OK了。 #============================================================================ RMXP = "C:/RPG Maker XP/RGSS/Standard/" # 素材库地址,根据个人情况设置 #========================== # 拷贝文件的函数 (by kaien) #========================== class File def copy(from,to) begin #读取文件 file = File.open(from,"rb") fsize = FileTest.size(from) str = file.read(fsize) file.close #输出保存 file1 = File.open(to,"wb") file1.write(str) file1.close
rescue end end end module DumpRgss def self.dump @rgss_list = [] @rgss_dir = { 'BGM' => 'Audio/BGM', 'BGS' => 'Audio/BGS', 'ME' => 'Audio/ME', 'SE' => 'Audio/SE', 'Animations' => 'Graphics/Animations', 'Autotiles' => 'Graphics/Autotiles', 'Battlebacks' => 'Graphics/Battlebacks', 'Battlers' => 'Graphics/Battlers', 'Characters' => 'Graphics/Characters', 'Fogs' => 'Graphics/Fogs', 'Gameovers' => 'Graphics/Gameovers', 'Icons' => 'Graphics/Icons', 'Panoramas' => 'Graphics/Panoramas', 'Pictures' => 'Graphics/Pictures', 'Tilesets' => 'Graphics/Tilesets', 'Titles' => 'Graphics/Titles', 'Transitions' => 'Graphics/Transitions', 'Windowskins' => 'Graphics/Windowskins' } base_data = ['Actors', 'Animations', 'Armors', 'Enemies', 'Items', 'Skills', 'Tilesets', 'Weapons'] rgss_data = { 'menu_se' => 'SE', 'animation_name' => 'Animations', 'battler_name' => 'Battlers', 'battleback_name' => 'Battlebacks', 'character_name' => 'Characters', 'fog_name' => 'Fogs', 'icon_name' => 'Icons', 'panorama_name' => 'Panoramas', 'tileset_name' => 'Tilesets' } for fnbase in base_data rxdata = self.open_file(fnbase) for data in rxdata for data_key in rgss_data.keys begin data_value = eval('data.' + data_key) self.push_to_list(rgss_data[data_key], data_value) rescue end # begin end # for data_key # Animations.rxdata if fnbase == 'Animations' begin for timing in data.timings self.push_to_list('SE', timing.se) end # for timing rescue end # begin elsif fnbase == 'Tilesets' begin for autotile_name in data.autotile_names self.push_to_list('Autotiles', autotile_name) end # for timing rescue end # begin end end # for data end # for fnbase # System.rxdata rgss_data = { 'battleback_name' => 'Battlebacks', 'battler_name' => 'Battlers', 'windowskin_name' => 'Windowskins', 'gameover_name' => 'Gameovers', 'title_name' => 'Titles', 'battle_transition' => 'Transitions', 'title_bgm' => 'BGM', 'battle_bgm' => 'BGM', 'battle_end_me' => 'ME', 'gameover_me' => 'ME', 'cursor_se' => 'SE', 'decision_se' => 'SE', 'cancel_se' => 'SE', 'buzzer_se' => 'SE', 'equip_se' => 'SE', 'shop_se' => 'SE', 'save_se' => 'SE', 'load_se' => 'SE', 'battle_start_se' => 'SE', 'escape_se' => 'SE', 'actor_collapse_se' => 'SE', 'enemy_collapse_se' => 'SE' } rxdata = self.open_file('System') for data_key in rgss_data.keys begin data_value = eval('rxdata.' + data_key) self.push_to_list(rgss_data[data_key], data_value) rescue end # begin end # for data_key # CommonEvents.rxdata rxdata = self.open_file('CommonEvents') for data in rxdata begin self.dump_event_list(data.list) rescue end # begin end # Troops (events) data rxdata = self.open_file('Troops') for data in rxdata begin for page in data.pages self.dump_event_list(page.list) end # begin rescue end end # Map (events) data fldata = 'Data/MapInfos.rxdata' mapinfos = load_data(fldata) for mapinfo in mapinfos rxdata = self.open_file(sprintf('Map%03d', mapinfo[0])) begin self.push_to_list('BGM', rxdata.bgm) self.push_to_list('BGS', rxdata.bgs) rescue end # begin # Events for event in rxdata.events.values for page in event.pages begin self.push_to_list('Characters', page.graphic.character_name) self.dump_custom_move_list(page.move_route.list) self.dump_event_list(page.list) rescue end # begin end end end # Save @rgss_list.shift f = open('./dump_rgss.txt', 'w') begin for rgss in @rgss_list printf(f, '%s%s', rgss, "\n") end ensure f.close end p '素材提取完毕!' end def self.open_file(fndata) fldata = sprintf('Data/%s.rxdata', fndata) @rgss_list.push('') @rgss_list.push(sprintf('[%s]', fldata)) return load_data(fldata) end def self.push_to_list(dir_key, value) # Audio/SE if value.is_a?(RPG::AudioFile) value = value.name end if value != '' flrgss = sprintf('%s/%s', @rgss_dir[dir_key], value) if File.exist?(RMXP+flrgss+".jpg") # p RMXP+flrgss+".jpg" # p flrgss+".jpg" File.copy(RMXP+flrgss+".jpg",flrgss+".jpg") end if File.exist?(RMXP+flrgss+".bmp") File.copy(RMXP+flrgss+".bmp",flrgss+".bmp") end if File.exist?(RMXP+flrgss+".png") File.copy(RMXP+flrgss+".png",flrgss+".png") end if File.exist?(RMXP+flrgss+".wav") File.copy(RMXP+flrgss+".wav",flrgss+".wav") end if File.exist?(RMXP+flrgss+".mp3") File.copy(RMXP+flrgss+".mp3",flrgss+".mp3") end if File.exist?(RMXP+flrgss+".mid") File.copy(RMXP+flrgss+".mid",flrgss+".mid") end if File.exist?(RMXP+flrgss+".wma") File.copy(RMXP+flrgss+".wma",flrgss+".wma") end if File.exist?(RMXP+flrgss+".ogg") File.copy(RMXP+flrgss+".ogg",flrgss+".ogg") end #if @rgss_list.include?(flrgss) #flrgss = sprintf('>%s', flrgss) #end @rgss_list.push(flrgss) end end def self.dump_event_list(event_commands) for event_command in event_commands self.dump_event(event_command) end end def self.dump_event(event_command) parameters = event_command.parameters case event_command.code when 131 self.push_to_list('Windowskins', parameters[0]) when 132 self.push_to_list('BGM', parameters[0]) when 133 self.push_to_list('ME', parameters[0]) when 204 case parameters[0] when 0 self.push_to_list('Panoramas', parameters[1]) when 1 self.push_to_list('Fogs', parameters[1]) when 2 self.push_to_list('Battlebacks', parameters[1]) end when 209 dump_custom_move_list(parameters[1].list) when 222 self.push_to_list('Transitions', parameters[0]) when 231 self.push_to_list('Pictures', parameters[1]) when 241 self.push_to_list('BGM', parameters[0]) when 245 self.push_to_list('BGS', parameters[0]) when 249 self.push_to_list('ME', parameters[0]) when 250 self.push_to_list('SE', parameters[0]) when 322 self.push_to_list('Characters', parameters[1]) self.push_to_list('Battlers', parameters[3]) end end def self.dump_custom_move_list(move_commands) for move_command in move_commands self.dump_custom_move(move_command) end end def self.dump_custom_move(move_command) parameters = move_command.parameters case move_command.code when 41 self.push_to_list('Characters', parameters[0]) when 44 self.push_to_list('SE', parameters[0]) end
end end DumpRgss.dump
#============================================================================
# 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息,使用……只能用一次
# 核心作者:RoyRoy
# 修正:kaien
# 使用方法:
# 1、首先输入RMXP的标准素材库地址,下面给出的是默认地址
# 2、运行脚本就OK了。
#============================================================================
RMXP = "C:/RPG Maker XP/RGSS/Standard/" # 素材库地址,根据个人情况设置
#==========================
# 拷贝文件的函数 (by kaien)
#==========================
class File
def copy(from,to)
begin
#读取文件
file = File.open(from,"rb")
fsize = FileTest.size(from)
str = file.read(fsize)
file.close
#输出保存
file1 = File.open(to,"wb")
file1.write(str)
file1.close
rescue
end
end
end
module DumpRgss
def self.dump
@rgss_list = []
@rgss_dir = {
'BGM' => 'Audio/BGM',
'BGS' => 'Audio/BGS',
'ME' => 'Audio/ME',
'SE' => 'Audio/SE',
'Animations' => 'Graphics/Animations',
'Autotiles' => 'Graphics/Autotiles',
'Battlebacks' => 'Graphics/Battlebacks',
'Battlers' => 'Graphics/Battlers',
'Characters' => 'Graphics/Characters',
'Fogs' => 'Graphics/Fogs',
'Gameovers' => 'Graphics/Gameovers',
'Icons' => 'Graphics/Icons',
'Panoramas' => 'Graphics/Panoramas',
'Pictures' => 'Graphics/Pictures',
'Tilesets' => 'Graphics/Tilesets',
'Titles' => 'Graphics/Titles',
'Transitions' => 'Graphics/Transitions',
'Windowskins' => 'Graphics/Windowskins'
}
base_data = ['Actors', 'Animations', 'Armors', 'Enemies', 'Items',
'Skills', 'Tilesets', 'Weapons']
rgss_data = {
'menu_se' => 'SE',
'animation_name' => 'Animations',
'battler_name' => 'Battlers',
'battleback_name' => 'Battlebacks',
'character_name' => 'Characters',
'fog_name' => 'Fogs',
'icon_name' => 'Icons',
'panorama_name' => 'Panoramas',
'tileset_name' => 'Tilesets'
}
for fnbase in base_data
rxdata = self.open_file(fnbase)
for data in rxdata
for data_key in rgss_data.keys
begin
data_value = eval('data.' + data_key)
self.push_to_list(rgss_data[data_key], data_value)
rescue
end # begin
end # for data_key
# Animations.rxdata
if fnbase == 'Animations'
begin
for timing in data.timings
self.push_to_list('SE', timing.se)
end # for timing
rescue
end # begin
elsif fnbase == 'Tilesets'
begin
for autotile_name in data.autotile_names
self.push_to_list('Autotiles', autotile_name)
end # for timing
rescue
end # begin
end
end # for data
end # for fnbase
# System.rxdata
rgss_data = {
'battleback_name' => 'Battlebacks',
'battler_name' => 'Battlers',
'windowskin_name' => 'Windowskins',
'gameover_name' => 'Gameovers',
'title_name' => 'Titles',
'battle_transition' => 'Transitions',
'title_bgm' => 'BGM',
'battle_bgm' => 'BGM',
'battle_end_me' => 'ME',
'gameover_me' => 'ME',
'cursor_se' => 'SE',
'decision_se' => 'SE',
'cancel_se' => 'SE',
'buzzer_se' => 'SE',
'equip_se' => 'SE',
'shop_se' => 'SE',
'save_se' => 'SE',
'load_se' => 'SE',
'battle_start_se' => 'SE',
'escape_se' => 'SE',
'actor_collapse_se' => 'SE',
'enemy_collapse_se' => 'SE'
}
rxdata = self.open_file('System')
for data_key in rgss_data.keys
begin
data_value = eval('rxdata.' + data_key)
self.push_to_list(rgss_data[data_key], data_value)
rescue
end # begin
end # for data_key
# CommonEvents.rxdata
rxdata = self.open_file('CommonEvents')
for data in rxdata
begin
self.dump_event_list(data.list)
rescue
end # begin
end
# Troops (events) data
rxdata = self.open_file('Troops')
for data in rxdata
begin
for page in data.pages
self.dump_event_list(page.list)
end # begin
rescue
end
end
# Map (events) data
fldata = 'Data/MapInfos.rxdata'
mapinfos = load_data(fldata)
for mapinfo in mapinfos
rxdata = self.open_file(sprintf('Map%03d', mapinfo[0]))
begin
self.push_to_list('BGM', rxdata.bgm)
self.push_to_list('BGS', rxdata.bgs)
rescue
end # begin
# Events
for event in rxdata.events.values
for page in event.pages
begin
self.push_to_list('Characters', page.graphic.character_name)
self.dump_custom_move_list(page.move_route.list)
self.dump_event_list(page.list)
rescue
end # begin
end
end
end
# Save
@rgss_list.shift
f = open('./dump_rgss.txt', 'w')
begin
for rgss in @rgss_list
printf(f, '%s%s', rgss, "\n")
end
ensure
f.close
end
p '素材提取完毕!'
end
def self.open_file(fndata)
fldata = sprintf('Data/%s.rxdata', fndata)
@rgss_list.push('')
@rgss_list.push(sprintf('[%s]', fldata))
return load_data(fldata)
end
def self.push_to_list(dir_key, value)
# Audio/SE
if value.is_a?(RPG::AudioFile)
value = value.name
end
if value != ''
flrgss = sprintf('%s/%s', @rgss_dir[dir_key], value)
if File.exist?(RMXP+flrgss+".jpg")
# p RMXP+flrgss+".jpg"
# p flrgss+".jpg"
File.copy(RMXP+flrgss+".jpg",flrgss+".jpg")
end
if File.exist?(RMXP+flrgss+".bmp")
File.copy(RMXP+flrgss+".bmp",flrgss+".bmp")
end
if File.exist?(RMXP+flrgss+".png")
File.copy(RMXP+flrgss+".png",flrgss+".png")
end
if File.exist?(RMXP+flrgss+".wav")
File.copy(RMXP+flrgss+".wav",flrgss+".wav")
end
if File.exist?(RMXP+flrgss+".mp3")
File.copy(RMXP+flrgss+".mp3",flrgss+".mp3")
end
if File.exist?(RMXP+flrgss+".mid")
File.copy(RMXP+flrgss+".mid",flrgss+".mid")
end
if File.exist?(RMXP+flrgss+".wma")
File.copy(RMXP+flrgss+".wma",flrgss+".wma")
end
if File.exist?(RMXP+flrgss+".ogg")
File.copy(RMXP+flrgss+".ogg",flrgss+".ogg")
end
#if @rgss_list.include?(flrgss)
#flrgss = sprintf('>%s', flrgss)
#end
@rgss_list.push(flrgss)
end
end
def self.dump_event_list(event_commands)
for event_command in event_commands
self.dump_event(event_command)
end
end
def self.dump_event(event_command)
parameters = event_command.parameters
case event_command.code
when 131
self.push_to_list('Windowskins', parameters[0])
when 132
self.push_to_list('BGM', parameters[0])
when 133
self.push_to_list('ME', parameters[0])
when 204
case parameters[0]
when 0
self.push_to_list('Panoramas', parameters[1])
when 1
self.push_to_list('Fogs', parameters[1])
when 2
self.push_to_list('Battlebacks', parameters[1])
end
when 209
dump_custom_move_list(parameters[1].list)
when 222
self.push_to_list('Transitions', parameters[0])
when 231
self.push_to_list('Pictures', parameters[1])
when 241
self.push_to_list('BGM', parameters[0])
when 245
self.push_to_list('BGS', parameters[0])
when 249
self.push_to_list('ME', parameters[0])
when 250
self.push_to_list('SE', parameters[0])
when 322
self.push_to_list('Characters', parameters[1])
self.push_to_list('Battlers', parameters[3])
end
end
def self.dump_custom_move_list(move_commands)
for move_command in move_commands
self.dump_custom_move(move_command)
end
end
def self.dump_custom_move(move_command)
parameters = move_command.parameters
case move_command.code
when 41
self.push_to_list('Characters', parameters[0])
when 44
self.push_to_list('SE', parameters[0])
end
end
end
DumpRgss.dump
|
|