Repository navigation
Data Packet Development Guide
A Data Pack defines game content using the TOML format.
一个数据包使用 TOML 格式来定义游戏内容。
All data packs must follow the structural and naming conventions described in this document to ensure compatibility with the engine.
所有数据包都必须遵循本文件中描述的结构和命名规范,以确保与引擎的兼容性。
All data files within a data pack:
一个数据包内的所有数据文件:
-
Must be written in TOML.
-
必须 以 TOML 格式书写。
-
Must use UTF-8 encoding.
-
必须 使用 UTF-8 编码。
-
Must follow the required file naming convention.
-
必须 遵循规定的文件命名规范。
All data files must follow the format:
所有数据文件都必须遵循以下格式:
<file_name>.<data_type>.toml
Where:
格式说明:
-
<file_name>is a descriptive file name used for organization purposes only. -
<file_name>这是一个用于组织目的的描述性文件名。 -
<data_type>specifies the type of data defined in the file. -
<data_type>指明了文件中所定义的数据类型。 -
.tomlis the required file extension. -
.toml这是所需的文件扩展名。
Example
示例
starter_room.prefab.toml
iron_ore.tile.toml
forest.biome.toml
Important: The file name is not used as the resource identifier inside the engine.
重要提示:文件名在引擎内部并不用作资源标识符。
Each data pack must contain a manifest.toml file located in the root directory.
每个数据包都必须包含位于根目录下的一个名为manifest.toml的文件。
The manifest.toml file defines metadata such as:
该manifest.toml文件会定义一些元数据,例如:
id = "glimmerworks"
resPack = false
author = "Cold-Mint"
versionName = "1.0"
versionNumber = 1
minGameVersion = 1
[name]
packId = "@self"
resourceType = 1
resourceKey = "dataPacksName"
[description]
packId = "@self"
resourceType = 1
resourceKey = "dataPacksDescription"
A data pack without a valid manifest.toml will not be loaded.
没有有效的manifest.toml文件,数据包将无法被加载。