赞 | 7 |
VIP | 24 |
好人卡 | 24 |
积分 | 2 |
经验 | 10343 |
最后登录 | 2023-5-26 |
在线时间 | 2133 小时 |
Lv1.梦旅人 派大星
- 梦石
- 0
- 星屑
- 195
- 在线时间
- 2133 小时
- 注册时间
- 2011-9-18
- 帖子
- 2652
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- 【糟糕VX脚本又一枚】RMVX的RTP素材提取脚本
- 2009-10-03 11:49
- 如题。大约一年前写的,(我记得)在6R发布过但找不到了= =
- 核心完全参照XP版(写的时候还参照过http://rpg.blue/viewthread.php?tid=101473)所以几乎可以说是毫无技术含量
- 使用方法:使用前先备份RTP……把脚本复制到main上方就可以了(根目录下会生成被提取文件名的txt)用完以后把此脚本删了,然后把RTP恢复。……应该能提取基于事件的所有RTP使用吧?如有遗漏请联系我。
- 要说缺点的话,这儿有3个
- 1.由于原作者和我都很偷懒,因此SE文件夹是无差别直接拿来的……不过整个SE才900K所以没问题吧?(<-殴
- 2.关于脚本调用Sprite或者Bitmap什么的还在远目中……不过有谁能提供方法的话我倒是乐意尝试
- (不过,用脚本调用的应该不会是RTP吧?)
- 3.整个过程是剪切不是复制……所以使用前务必备份RTP
- ----------------------------------------------------------------------------
- #============================================================================
- # 核心作者:RoyRoy VX化:superufo(小幽)
- # 使用方法:
- # 1、首先输入RMVX的标准素材库地址
- # 2、运行脚本就OK了。
- # ★★特别声明!!运用此脚本会删掉你给的路径的素材库★★请自己备份好★★★★
- #============================================================================
- RMVX = "F:/Program Files/RPGVX/RGSS2/" # 素材库地址
- module DumpRgss
- def self.dump
- @rgss_list = []
- @rgss_dir = {
- 'BGM' => 'Audio/BGM',
- 'BGS' => 'Audio/BGS',
- 'ME' => 'Audio/ME',
- 'SE' => 'Audio/SE',
- 'fonts' => 'Fonts',
- 'Animations' => 'Graphics/Animations',
- 'Battlers' => 'Graphics/Battlers',
- 'Characters' => 'Graphics/Characters',
- 'Faces' => 'Graphics/Faces',
- 'Parallaxes' => 'Graphics/Parallaxes',
- 'System' => 'Graphics/System'
- }
- base_data = ['Actors', 'Animations', 'Enemies']
- rgss_data = {
- 'animation1_name' => 'Animations',
- 'animation2_name' => 'Animations',
- 'battler_name' => 'Battlers',
- 'character_name' => 'Characters',
- 'face_name' => 'Faces',
- }
- for fnbase in base_data
- rvdata = self.open_file(fnbase)
- for data in rvdata
- 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.rvdata
- if fnbase == 'Animations'
- begin
- for timing in data.timings
- self.push_to_list('SE', timing.se.name)
- end # for timing
- rescue
- end # begin
- end
- end # for data
- end # for fnbase
-
- # System.rvdata
- rgss_data = {
- 'boat' => 'Characters',
- 'ship' => 'Characters',
- 'air' => 'Characters',
- 'title_bgm' => 'BGM',
- 'battle_bgm' => 'BGM',
- 'battle_end_me' => 'ME',
- 'gameover_me' => 'ME',
- 'name' => 'SE'
- }
- rvdata = self.open_file('System')
- self.push_to_list('BGM', rvdata.title_bgm.name)
- self.push_to_list('BGM', rvdata.battle_bgm.name)
- self.push_to_list('ME', rvdata.battle_end_me.name)
- self.push_to_list('ME', rvdata.gameover_me.name)
- self.push_to_list('Characters', rvdata.boat.character_name)
- self.push_to_list('Characters', rvdata.ship.character_name)
- self.push_to_list('Characters', rvdata.airship.character_name)
- for data_key in rgss_data.keys
- begin
- data_value = eval('rvdata.' + data_key)
- self.push_to_list(rgss_data[data_key.name], data_value)
- if data_value == 'sounds'
- for sound in data_value
- sound_value = eval('rvdata.' + sound)
- self.push_to_list(rgss_data[sound], sound_value)
- end
- elsif data_value == 'boat'
- self.push_to_list(rgss_data[data_key.character_name], data_value)
- elsif data_value == 'ship'
- self.push_to_list(rgss_data[data_key.character_name], data_value)
- elsif data_value == 'air'
- self.push_to_list(rgss_data[data_key.character_name], data_value)
- end
- rescue
- end # begin
- end # for data_key
-
- # CommonEvents.rvdata
- rvdata = self.open_file('CommonEvents')
-
- for data in rvdata
- begin
- self.dump_event_list(data.list)
- rescue
- end # begin
- end
-
- # Troops (events) data
- rvdata = self.open_file('Troops')
-
- for data in rvdata
- begin
- for page in data.pages
- self.dump_event_list(page.list)
- end # begin
- rescue
- end
- end
-
- # Map (events) data
- fldata = 'Data/MapInfos.rvdata'
- mapinfos = load_data(fldata)
- for mapinfo in mapinfos
- rvdata = self.open_file(sprintf('Map%03d', mapinfo[0]))
- begin
- self.push_to_list('BGM', rvdata.bgm)
- self.push_to_list('BGS', rvdata.bgs)
- self.push_to_list('Parallaxes', rvdata.parallax_name)
- rescue
- end # begin
- # Events
- for event in rvdata.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
- #System
- @rgss_list.push('System')
- begin
- self.push_to_list('System','Balloon')
- self.push_to_list('System','BattleFloor')
- self.push_to_list('System','BattleStart')
- self.push_to_list('System','GameOver')
- self.push_to_list('System','IconSet')
- self.push_to_list('System','MessageBack')
- self.push_to_list('System','Shadow')
- self.push_to_list('System','TileA1')
- self.push_to_list('System','TileA2')
- self.push_to_list('System','TileA3')
- self.push_to_list('System','TileA4')
- self.push_to_list('System','TileA5')
- self.push_to_list('System','TileB')
- self.push_to_list('System','TileC')
- self.push_to_list('System','TileD')
- self.push_to_list('System','TileE')
- self.push_to_list('System','Title')
- self.push_to_list('System','Window')
- rescue
- 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
-
- end
- def self.open_file(fndata)
- fldata = sprintf('Data/%s.rvdata', 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?(RMVX+flrgss+".jpg")
- File.rename(RMVX+flrgss+".jpg",flrgss+".jpg")
- end
- if File.exist?(RMVX+flrgss+".bmp")
- File.rename(RMVX+flrgss+".bmp",flrgss+".bmp")
- end
- if File.exist?(RMVX+flrgss+".png")
- File.rename(RMVX+flrgss+".png",flrgss+".png")
- end
- if File.exist?(RMVX+flrgss+".wav")
- File.rename(RMVX+flrgss+".wav",flrgss+".wav")
- end
- if File.exist?(RMVX+flrgss+".mp3")
- File.rename(RMVX+flrgss+".mp3",flrgss+".mp3")
- end
- if File.exist?(RMVX+flrgss+".mid")
- File.rename(RMVX+flrgss+".mid",flrgss+".mid")
- end
- if File.exist?(RMVX+flrgss+".wma")
- File.rename(RMVX+flrgss+".wma",flrgss+".wma")
- end
- if File.exist?(RMVX+flrgss+".ogg")
- File.rename(RMVX+flrgss+".ogg",flrgss+".ogg")
- 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 101
- self.push_to_list('Faces', parameters[0])
- when 132
- self.push_to_list('BGM', parameters[0])
- when 133
- self.push_to_list('ME', parameters[0])
- when 205
- dump_custom_move_list(parameters[1].list)
- 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('Faces', parameters[3])
- when 323
- self.push_to_list('Characters', parameters[1])
- 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
- p "Done"
复制代码 原地址:http://hi.baidu.com/mars_superuf ... 97b319632798c2.html |
评分
-
查看全部评分
|