赞 | 5 |
VIP | 464 |
好人卡 | 4 |
积分 | 4 |
经验 | 14189 |
最后登录 | 2020-6-13 |
在线时间 | 972 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 403
- 在线时间
- 972 小时
- 注册时间
- 2007-12-31
- 帖子
- 2137
|
本帖最后由 liqunsz 于 2010-6-28 17:50 编辑
…………你不说清楚点…………我的错我的错……
人家明明全名叫做【游戏发布【素材】提取器】
步骤如下:
1.将数据库中的不使用的动画、图块项删掉
2.复制RMXP安装目录的RGSS/Standard的内容,与你游戏新增的素材相合并
3.复制此脚本并将脚本中【RMXP = "C:/Program Files/RPG Maker XP/RGSS/Standard/"】中的
"C:/Program Files/RPG Maker XP/RGSS/Standard/"修改为你游戏的目录
4.运行游戏(如果指定到安装目录的RTP,原RTP会损坏)
脚本如下:- #============================================================================
- # 本脚本来自www.66rpg.com,转载请保留此信息,使用……只能用一次
- # 核心作者:RoyRoy
- # 使用方法:
- # 1、首先输入RMXP的标准素材库地址,下面给出的是默认地址
- # 2、运行脚本就OK了。
- # ★★特别声明!!运用此脚本会删掉你给的路径的素材库★★请自己备份好★★★★
- #============================================================================
- RMXP = "C:/Program Files/RPG Maker XP/RGSS/Standard/" # 素材库地址
-
- 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 'dump end'
- 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")
- File.rename(RMXP+flrgss+".jpg",flrgss+".jpg")
- end
- if File.exist?(RMXP+flrgss+".bmp")
- File.rename(RMXP+flrgss+".bmp",flrgss+".bmp")
- end
- if File.exist?(RMXP+flrgss+".png")
- File.rename(RMXP+flrgss+".png",flrgss+".png")
- end
- if File.exist?(RMXP+flrgss+".wav")
- File.rename(RMXP+flrgss+".wav",flrgss+".wav")
- end
- if File.exist?(RMXP+flrgss+".mp3")
- File.rename(RMXP+flrgss+".mp3",flrgss+".mp3")
- end
- if File.exist?(RMXP+flrgss+".mid")
- File.rename(RMXP+flrgss+".mid",flrgss+".mid")
- end
- if File.exist?(RMXP+flrgss+".wma")
- File.rename(RMXP+flrgss+".wma",flrgss+".wma")
- end
- if File.exist?(RMXP+flrgss+".ogg")
- File.rename(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
复制代码 注意,你新增加的脚本或修改原来的脚本可能会增加一些图片、音效之类的,这个提取器是不会提取的……
我相信LZ你的理解力也不算太差啊,这个在发布页上都已经写了方法了啊……
游戏制作完成之后把素材提取到自己游戏里面。
特别注意:
提取得不保证非常完整。素材肯定不会多,只可能少……缩减自己游戏体积专用
缩减的一些其他窍门:运行此脚本前,把没用的数据库动画,数据库图块都删了,能变小不少
插入脚本,运行。注意默认情况下会把安装目录下的RMXP素材库破坏,请看脚本
1、首先输入RMXP的标准素材库地址,下面给出的是默认地址
2、运行脚本就OK了。
LZ不仔细看说明额…… |
|