查看: 3940|回复: 5

[已经解决] 请问如何让没使用的默认素材在生成游戏时不要导出

[复制链接]
梦石
0
星屑
50
在线时间
39 小时
注册时间
2015-11-17
回帖
33
发表于 2015-12-5 22:10:48 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
生成游戏后容量太大了,如果自己手动删除那些没有使用的默认素材,又怕生成游戏后在测试时出错,有没有办法让那些素材不要一起导出?
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-12-5 22:30:46 | 显示全部楼层
本帖最后由 tseyik 于 2015-12-5 22:32 编辑

[fold=SAN_VirtualRTP 0.1]//=============================================================================
// SAN_VirtualRTP.js
//=============================================================================
// Copyright (c) 2015 Sanshiro
// Released under the MIT license
// http://opensource.org/licenses/mit-license.php
//=============================================================================

/*:
* @plugindesc SAN_VirtualRTP ver0.10
* Read material files from dir by plugin parameter pointed path.
*
* @help
*
* THIS PLUGIN IS EXPEROMENTAL VERSION!!
*
* It's possible to commercial use, distribute, and modify under the MIT license.
* But, don't eliminate and don't alter a comment of the beginning.
* If it's good, please indicate an author name on credit.
*
* Author doesn't shoulder any responsibility in all kind of damage by using this.
* And please don't expect support. X(
*
* @param imgPath
* @desc Image dir path. Set Index.html's dir path of VRTP. relative path is also possible.
* @default file:///C:/Program Files (x86)/KADOKAWA/RPGMV/NewData/
*
* @param audioPath
* @desc Audio dir path. Set Index.html's dir path of VRTP. relative path is also possible.
* @default file:///C:/Program Files (x86)/KADOKAWA/RPGMV/NewData/
*
* @param dataPath
* @desc Data dir path. Set Index.html's dir path of VRTP. relative path is also possible.
* @default ./
*
*/

/*:ja
* @plugindesc バーチャルRTP ver0.10
* プラグインパラメータのパスから素材ファイルを読込みます。
* @author サンシロ https://twitter.com/rev2nym
* @version 0.10 2015/11/30 HTTPサーバー、ブラウザプレイに暫定対応、名前空間、著作権表記追加
* 0.02 2015/11/13 img, audio, dataフォルダのパスを個別に設定するよう変更
* 0.01 2015/11/11 VirtualRTP ver 0.01 として再公開
*
* @help
* プラグインパラメータで指定したパスから画像と音声ファイルを読み込みます。
* パスはPlugins.jsを直接編集することでも設定可能です。
* 素材フォルダパスを指定することでゲームフォルダのimg, audioフォルダを削除することができます。
*
* ※注意:上記フォルダを削除するとRPG Maker MVのエディタ上でも素材が削除されます。
*
* 以下の環境で動作確認をしています。
* ・RPG Maker MVのテストプレイ起動
* ・Windows向け.exeファイル起動
* ・Chrome (起動オプション : --allow-file-access-from-files)
* ・Firefox (about:config で security.fileuri.strict_origin_policy を false に設定)
*
* ※注意:上記ブラウザ設定はJavaScriptの同一生成元ポリシーによるセキュリティ対策を無効化するものです。
*
* これを利用したことによるいかなる損害にも作者は責任を負いません。
* サポートは期待しないでください><。
*
* @param imgPath
* @desc 画像素材フォルダのパスです。Index.htmlがあるべき場所を指定してください。相対パスも可能です。
* @default file:///C:/Program Files (x86)/KADOKAWA/RPGMV/NewData/
*
* @param audioPath
* @desc 音声素材フォルダのパスです。Index.htmlがあるべき場所を指定してください。相対パスも可能です。
* @default file:///C:/Program Files (x86)/KADOKAWA/RPGMV/NewData/
*
* @param dataPath
* @desc ゲームデータフォルダのパスです。Index.htmlがあるべき場所を指定してください。相対パスも可能です。
* @default ./
*/

var Imported = Imported || {};
Imported.SAN_VirtualRTP = true;

var Sanshiro = Sanshiro || {};
Sanshiro.VirtualRTP = Sanshiro.VirtualRTP || {};

(function() {

    function VirtualRTP() {};

    VirtualRTP.solveRelativePath = function(path) {
        var indexPath     = window.location.href;
        var directoryPath = indexPath.replace(/\/[^/]*$/, '');
        if ((/^\.\.\//).test(path)) {
            path = path.replace(/^\.\./, directoryPath.replace(/\/[^/]*$/, ''));
        } else if ((/^\.\//).test(path)) {
            path = path.replace(/^\./, directoryPath);
        }
        return path
    };

    VirtualRTP.imgPath   = VirtualRTP.solveRelativePath(PluginManager.parameters('SAN_VirtualRTP')['imgPath']);
    VirtualRTP.audioPath = VirtualRTP.solveRelativePath(PluginManager.parameters('SAN_VirtualRTP')['audioPath']);
    VirtualRTP.dataPath  = VirtualRTP.solveRelativePath(PluginManager.parameters('SAN_VirtualRTP')['dataPath']);

    AudioManager._path = VirtualRTP.audioPath + AudioManager._path;

    ImageManager.loadAnimation = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/animations/', filename, hue, true);
    };

    ImageManager.loadBattleback1 = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/battlebacks1/', filename, hue, true);
    };

    ImageManager.loadBattleback2 = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/battlebacks2/', filename, hue, true);
    };

    ImageManager.loadEnemy = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/enemies/', filename, hue, true);
    };

    ImageManager.loadCharacter = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/characters/', filename, hue, false);
    };

    ImageManager.loadFace = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/faces/', filename, hue, true);
    };

    ImageManager.loadParallax = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/parallaxes/', filename, hue, true);
    };

    ImageManager.loadPicture = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/pictures/', filename, hue, true);
    };

    ImageManager.loadSvActor = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/sv_actors/', filename, hue, false);
    };

    ImageManager.loadSvEnemy = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/sv_enemies/', filename, hue, true);
    };

    ImageManager.loadSystem = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/system/', filename, hue, false);
    };

    ImageManager.loadTileset = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/tilesets/', filename, hue, false);
    };

    ImageManager.loadTitle1 = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/titles1/', filename, hue, true);
    };

    ImageManager.loadTitle2 = function(filename, hue) {
        return this.loadBitmap(VirtualRTP.imgPath + 'img/titles2/', filename, hue, true);
    };

    DataManager.loadDataFile = function(name, src) {
        var xhr = new XMLHttpRequest();
        var url = VirtualRTP.dataPath + 'data/' + src;
        xhr.open('GET', url);
        xhr.overrideMimeType('application/json');
        xhr.onload = function() {
            if (xhr.status < 400) {
                window[name] = JSON.parse(xhr.responseText);
                DataManager.onLoad(window[name]);
            }
        };
        xhr.onerror = function() {
            DataManager._errorUrl = DataManager._errorUrl || url;
        };
        window[name] = null;
        xhr.send();
    };

    Sanshiro.VirtualRTP.Graphics__paintUpperCanvas = Graphics._paintUpperCanvas;
    Graphics._paintUpperCanvas = function() {
        try {
            Sanshiro.VirtualRTP.Graphics__paintUpperCanvas.call(this);
        } catch (e) {
            console.log(e);
        }
    };

})();[/fold]

点评

这个怎么用的?我试着打包了,没有效果哦  发表于 2015-12-5 23:58

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 0x0

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
39 小时
注册时间
2015-11-17
回帖
33
 楼主| 发表于 2015-12-6 01:10:12 | 显示全部楼层
tseyik 发表于 2015-12-5 22:30
[fold=SAN_VirtualRTP 0.1]//======================================================================== ...

插入之后,怎么不行哦?

点评

要設定NEWDATA文件夾所在  发表于 2015-12-6 01:48
回复

使用道具 举报

梦石
0
星屑
50
在线时间
39 小时
注册时间
2015-11-17
回帖
33
 楼主| 发表于 2015-12-6 18:50:18 | 显示全部楼层
tseyik 发表于 2015-12-5 22:30
[fold=SAN_VirtualRTP 0.1]//======================================================================== ...

不太懂,能不能说详细一点,谢谢
回复

使用道具 举报

梦石
0
星屑
50
在线时间
39 小时
注册时间
2015-11-17
回帖
33
 楼主| 发表于 2015-12-8 17:44:39 | 显示全部楼层
本帖最后由 gohwish 于 2015-12-8 17:46 编辑


这样对吗?
回复

使用道具 举报

梦石
0
星屑
50
在线时间
35 小时
注册时间
2015-5-29
回帖
9
发表于 2015-12-8 18:20:24 | 显示全部楼层
https://rpg.blue/thread-386410-1-3.html
用它可以对你生成后导出的文件进行清理,和监测完整性

评分

参与人数 1星屑 +266 收起 理由
余烬之中 + 266 0x0

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部