Skip to main content

塞尔达传说:荒野之息的 mod builder/unbuilder

项目描述

海拉尔建造者

塞尔达传说:荒野之息的模组构建工具。

Hyrule Builder 旨在帮助 BOTW 模组制作者更轻松地管理和编辑他们的项目文件。它可以将游戏文件“解构”/“反编译”为类似源代码的格式。提取所有 SARC,将所有 BYML、AAMP 或 MSYT 文件转换为 YAML,并且使用规范路径专门未构建 actor 包。整个项目可以很容易地重建成可用的模组,并具有许多便利的功能来使过程顺利进行。

设置

安装 Python 3.7+(64 位版本),然后运行pip install hyrule_builder​​.

建造和拆建模组

要开始一个新的 Hyrule Builder 项目,请获取您想要使用的 mod 文件,并确保将它们放置在有效的文件夹结构中。Hyrule Builder 支持 Wii U 和 Switch 模组,但每个模组都有不同的格式。

Wii U 布局:

. (root mod folder)
├── content
│   └── (content folders, e.g. Actor, Pack, etc.)
└── aoc (for DLC files)
    └── (DLC folders, e.g. Map, Pack, etc.)

切换布局(注意:标题 ID 区分大小写):

. (root mod folder)
├── 01007EF00011E000 (base game files)
│   └── romfs
│       └── (content folders, e.g. Actor, Pack, etc.)
└── 01007EF00011F001 (DLC files)
    └── romfs
        └── (content folders, e.g. Map, Pack, etc.)

要将现有的 mod 文件转换为 Hyrule Builder 项目,请使用unbuild命令。例子:

hyrule_builder unbuild BreathOfTheWild_VeryCleverMod

拆建

有关取消构建 mod 的详细信息,请参阅unbuild命令的帮助:

usage: hyrule_builder unbuild [-h] [--output OUTPUT] [--single] [--verbose] directory

Unbuilds a mod into a source-like structure for editing

positional arguments:
  directory             The main mod folder. For Wii U, this must contain a `content` folder and/or an `aoc` folder (the latter for DLC files). For Switch, you must use the following layout:
                           .
                           ├─ 01007EF00011E000 (for base game files)
                           │  └─ romfs
                           └─ 01007EF00011F001 (for DLC files)
                              └─ romfs

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -O OUTPUT
                        Output folder for unbuilt mod
  --single, -S          Run with single thread
  --verbose, -V         Provide more detailed output

建造

有关构建 mod 的详细信息,请参阅build命令的帮助:

usage: hyrule_builder build [-h] [--be] [--no-rstb] [--no-guess] [--title-actors TITLE_ACTORS] [--output OUTPUT] [--single] [--verbose] directory

Builds a mod from a source-like structure into binary game files
Note: Flags can be set using a config.yml file. See readme for details.

positional arguments:
  directory             The main mod folder. For Wii U, this must contain a `content` folder and/or an `aoc` folder (the latter for DLC files). For Switch, you must use the following layout:
                           .
                           ├─ 01007EF00011E000 (for base game files)
                           │  └─ romfs
                           └─ 01007EF00011F001 (for DLC files)
                              └─ romfs

optional arguments:
  -h, --help            show this help message and exit
  --be, -B, -b          Use big endian where applicable
  --no-rstb, -R         Do not auto-update RSTB
  --no-guess, -G        Do not use RSTB estimates
  --no-warn, -W         Ignore warnings, only output success/error
  --hard-warn, -H       Abort on any warning like an error
  --title-actors TITLE_ACTORS, -T TITLE_ACTORS
                        Comma separated list of custom actors to add to TitleBG.pack, e.g.
                        `--title-actors=Weapon_Bow_001,Enemy_Golem_Senior`
  --output OUTPUT, -O OUTPUT
                        Output folder for built mod
  --single, -S          Run with single thread
  --verbose, -V         Provide more detailed output

请注意,可以推断字节序,unbuildbuild用于 Wii U/Cemu mods需要--be标志。

除非--no-rstb使用,否则构建 mod 将自动生成更新的 RSTB 文件。

正如帮助所说,您还可以通过提供config.yml 文件来配置构建命令,而不是使用命令行参数。它最多支持三个部分,每个部分都是可选的。该Meta部分提供将写入rules.txt输出模块中的文件的数据。该Flags部分通过列表中的名称打开简单的开关标志。该Options 部分用于存储任意值的标志,例如title-actorsor output。下面包含一个示例配置文件:

Meta: # specify data to go into a rules.txt file here
  name: A Mod
  description: My new mod
Flags: # list the switch flags you want turned on
  - be
  - no-warn
Options: # provide values for customizable flags
  title-actors: Weapon_Bow_001,Enemy_Lizalfos_Senior
  output: test/TestMod_built

项目布局注意事项

以前使用过 BOTW 模组(尤其是图形包)的任何人都会熟悉 Hyrule Builder 项目布局的大部分内容。但是,以下方面是 Hyrule Builder 独有的:

  • ActorInfo.product.sbyml成为Actor/ActorInfo包含每个参与者的单独 YAML 文件的文件夹。哈希列表是自动处理的。只需将新的 YAML 文件添加到文件夹中,即可将其添加到参与者列表和哈希列表中。
  • 大多数 SARC 文件都未使用其原始文件名构建,例如,Pack/TitleBG.pack只是变成一个具有相同名称的文件夹。但是,演员包未完全构建到Actor文件夹中,并从其演员链接文件重建。例如,如果您要Actor/ActorLink/Enemy_Lizalfos_Senior.bxml.yml在项目中创建一个新副本并将其命名为Enemy_Lizalfos_Geezer.bxml.yml,则仅此更改就会导致构建过程在Actor/Pack/Enemy_Lizalfos_Geezer.sbactorpack.
  • 出于安全原因,某些由标准 Nintendo 库而不是 BOTW 资源系统解析的 SARC 文件不会被取消构建。
  • RSTB 未构建为 JSON 文件,以便于编辑。格式示例:
    {
        "hash_map": {
            "Actor/ActorLink/Armor_064_Head.bxml": 2152,
            "Actor/ActorLink/FidObj_SecretBase_TorchStand_A_01.bxml": 2068,
            "165741": 78080,
            "Game/Stats/archive/I-7.00.stats": 392384,
            "Actor/ModelList/FldObj_SecretBaseRockBlock_E_01.bmodellist": 2640,
            "Actor/Physics/FldObj_HyliaStoneRuinGate_A_01.bphysics": 2864,
            "Actor/ModelList/WaterPump.bmodellist": 2576,
            "Actor/Pack/TwnObj_HyruleCastleObject_WeaponStand_B_01.bactorpack": 2560,
            "Actor/ModelList/TwnObj_Village_SheikerWallScroll_A_01.bmodellist": 2640,
            "Actor/Pack/TwnObj_Village_HatenoBanner_A_03.bactorpack": 2432,
            "Actor/ModelList/FldObj_WaterFallLakeFloria_A_S_02_Far.bmodellist": 2640,
            // etc...
        },
        "name_map": {
            "Actor/Physics/SwitchStepL.bphysics": 9652,
            "Actor/Physics/TwnObj_HyruleCastleObject_StoneStatue_B_01.bphysics": 2800,
            "Model/Item_Roast_08.Tex1.bfres": 28672,
            "Model/Item_Roast_08.Tex2.bfres": 28928,
            // and so on...
        }
    }
    

其他用途

Hyrule Builder 还包括几个额外的 CLI 工具,它们实现了它的一些功能以供单独使用。这包括 RSTB<->JSON 转换器和用于单个 SARC 文件的完整构建器/取消构建器。使用详情如下:

RSTB 转 JSON

usage: rstb_to_json [-h] [-b] [-o [OUTPUT]] [rstb]

Converts a binary RSTB file to JSON.

positional arguments:
  rstb                  Path to a binary RSTB file

optional arguments:
  -h, --help            show this help message and exit
  -b, --be              Read the RSTB as big endian for Wii U, otherwise little endian for Switch
  -o [OUTPUT], --output [OUTPUT]
                        Path to output JSON file

JSON 转 RSTB

usage: json_to_rstb [-h] [-b] [-o [OUTPUT]] [json]

Converts a JSON RSTB file to binary.

positional arguments:
  json                  Path to a JSON RSTB file

optional arguments:
  -h, --help            show this help message and exit
  -b, --be              Write the RSTB as big endian for Wii U, otherwise little endian for Switch
  -o [OUTPUT], --output [OUTPUT]
                        Path to output RSTB binary

取消构建 SARC

usage: unbuild_sarc [-h] [--output OUTPUT] sarc

Unbuild a single SARC file completely

positional arguments:
  sarc                  SARC archive to unbuild

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -O OUTPUT
                        Output folder for unbuilt SARC, defaults to file name w/o extension

构建 SARC

usage: build_sarc [-h] [--be] [--verbose] source output

Build a SARC file from a single source folder

positional arguments:
  source         Source folder for SARC
  output         Path to output SARC file, will auto compress if extension starts with ".s"

optional arguments:
  -h, --help     show this help message and exit
  --be, -B       Use big endian where applicable
  --verbose, -V  Provide more detailed output

执照

本软件根据 GNU 通用公共许可证第 3 版或更高版本的条款获得许可。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

hyrule_builder-0.7.4.tar.gz (998.3 kB 查看哈希)

已上传 source

内置分布

hyrule_builder-0.7.4-py3-none-any.whl (1.0 MB 查看哈希

已上传 py3