设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 97|回复: 0

[制作教程] Managing resource subfolders using hard links

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4461

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22929
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28284

    灌水之王

    发表于 7 天前 | 显示全部楼层 |阅读模式
    Originally posted at Hime Works

    Your project by default has a number of resource folders, stored in the Audio and Graphics folders such as Pictures, Battlers, BGM, and SE. However, if you have a large project, you may find yourself possibly having thousands of files in certain folders, making it difficult to manage your resources.

    You may consider organizing your files into subfolders grouped based on some logical classification scheme, but the problem with this approach is that the editor has hardcoded the resource folders and does not recognize any new ones. This is not an issue for scripts using custom folders, but if you want to use the event editor to show pictures or use the database editor to assign battler sprites it wouldn't work.

    However, with the use of "hard links", it is possible to to organize your resources in your own folders while developing your game.

    Required

    Hard links are available in Windows Vista and above without requiring any additional tools. If you are using older systems or non-windows systems, you will need to figure out the syntax for creating hard links there.

    Background

    If you don't know what a hard link is, you can read about it on wiki.

    Problem

    Suppose you have decided to organize your Tilesets folder like this:



    However when you try to create a new tileset, you will find that the editor doesn't see any of your custom resources.



    So now you have separate subfolders containing your resources, but the problem is that the editor only reads from the main Tilesets folder.

    Solution

    The trick is to create hard links with the following steps

    1. Get this batch file: download. You can create your own with this code:

    @echo offSetlocal EnableDelayedExpansionfor /R %%F in (*) do (  rem # make the filename  set _name=%%~fF  set _name=!_name:%cd%\=!  set _name=!_name:\=-!  rem # create hard link if it doesn't exist  if not "%%~dpF"=="%cd%\" (    if not exist !_name! (      mklink /H "!_name!" "%%F"    )  ))2. Place the file in the main resource folder (eg: Tilesets).3. Double-click the file to run the script.



    When the script has finished executing, your folder will contain a bunch of files that were in the subfolders, automatically prefixed with the folder names. This may look like a simple copy and paste, but the difference is that the new files and the files in the subfolders point to the same data.





    Now you can use them in your editor as usual





    You can even have files with duplicate names as long as they are in separate folders.

    Modifying existing resources

    When you modify one of the resources in the subfolders, you will notice that the file with the same in the main folder has also changed automatically. This allows you to only work with your resources in the subfolders and not have to worry about the files in the main folder.

    Adding new resources

    When you add a new resource to a subfolder, it does not automatically get added to the main folder. Simply run the batch script again to create new hard links.

    Publishing your game

    Notice that the hard links actually take up space, so you will use up double the space just to develop your game. However, when you are ready to distribute your game, you can simply delete all of your subfolders and then pack up the game.


    本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/managing-resource-subfolders-using-hard-links.16084/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 16:47 , Processed in 0.146092 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表