模组结构:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.1
无编辑摘要
→‎Tips
 
(未显示4个用户的4个中间版本)
第1行: 第1行:
{{version|1.1}}{{需要翻译}}
{{version|1.1}}{{需要翻译}}
Mods are located in the folder ''~\Paradox Interactive\Crusader Kings III\mod'':
Mods 文件位于 ''~\Paradox Interactive\Crusader Kings III\mod'' 文件夹中
* Default on Windows: {{cite file|%USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\mod}}
* Windows 下的默认路径: {{cite file|%USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\mod}}
* Default on Linux: {{cite file|~/.local/share/Paradox Interactive/Crusader Kings III/mod}}
* Linux 下的默认路径: {{cite file|~/.local/share/Paradox Interactive/Crusader Kings III/mod}}
Each mod requires two parts. Both must be located in the folder above and share the same name, barring file extensions; otherwise, the game launcher will ''not'' recognise the mod. Note that folder and file names are case sensitive on Mac and Linux.
每个mod需要两个部分:
* A .mod file, a plain text file with metadata required to use the mod.
* A mod folder containing files specific to modding the game, such as events, images, decisions and characters. It may also be a .zip file instead.


== Creating initial files ==
* 一个<code>.mod</code>后缀的纯文本文件,包含使用该mod所需的元数据
 
* 一个mod文件夹(或<code>.zip</code>文件),包含此mod对游戏的修改内容,如事件、图像、决议和角色
 
两部分都必须位于上面的文件夹中,并且共享相同的名称,但文件扩展名除外;否则,游戏启动器将无法识别mod。请注意,文件夹和文件名在Mac和Linux上是区分大小写的。
 
== 创建初始文件 ==
 
为了更为便捷以及避免人为错误,建议通过游戏启动器生成初始mod文件。
 
# 打开游戏启动器。
# 通过滚动或按“开始游戏”按钮下的 "Mod "标签,导航到 "Mods "部分。
# 点击"Mod工具 "按钮。
# 点击 "创建mod "按钮。
# 在这里,你可以创建你的mod,包括名称、版本(mod版本,而非游戏)、目录(将始终位于上述游戏的mod文件夹中)和任意标签。启动器提供的标签包括:


It is recommended to generate the initial mod files through the game launcher in the interests of speed and avoiding human error.
# Open the game launcher.
# Navigate to the "Mods" section, either by scrolling or pressing the "Mods" tab under the play button.
# Press the "Mod tools" button underneath your current playset.
# Press the "Create a mod" button.
# Here, you can create your mod with a name, version (mod, not game), directory (will always be located in the game's mod folder described above) and any tags. The tags offered by the launcher include:
{| class="wikitable"
{| class="wikitable"
|-
|-
第40行: 第46行:
|}
|}


It is also possible to change the suggested game version, thumbnail and description (for Steam Workshop) by going back to the "Mod tools" menu, and then selecting your mod in the drop-down list.
也可以通过回到 "Mod 工具 " 菜单,然后在下拉列表中选择你的mod来更改建议的游戏版本、缩略图和描述(显示在创意工坊里)。


This process will create the following:
这个过程将创建以下内容。
* The mod folder, named after your mod.
* mod 文件夹,以你的mod命名。
* A ''descriptor.mod'' file, contained within the mod folder.
* 一个descriptor.mod 文件,包含在mod文件夹内。
* Another .mod file, this one named after the mod, located alongside the mod folder.
* 另一个.mod 文件,这个文件以mod命名,位于mod文件夹旁边。


== *.mod 文件 ==
== *.mod 文件 ==


The .mod files used by the game are plain text files that contain metadata about their corresponding mod. There are two .mod files for every mod:
游戏使用的.mod 文件是纯文本文件,其中包含了相应mod的元数据。每个mod都有两个.mod 文件。
* ''(modname).mod'', located ''alongside'' the mod's folder. This one is required; without it, the launcher will not recognise the mod.
* (modname).mod ,位于mod的文件夹旁边。这个是必须的,没有它,启动器将无法识别mod。
* ''descriptor.mod'', located ''within'' the mod folder. It is recommended to keep this file consistent with the other one, excluding the line containing the ''path'' key which is not needed in the descriptor file.
* descriptor.mod ,位于mod文件夹内。建议这个文件和其他文件保持一致,删除文件中包含path键的行,因为这一行并不需要出现在描述文件中


=== Syntax ===
=== 语法 ===


Similar to other game files, single-line comments can be started using hash (<code>#</code>). To set a value to a key, use the format <code>key="value"</code> for single values; alternatively, use the following structure for lists:
与其他游戏文件类似,单行注释可以使用哈希(# )开始。要将一个值设置为一个键,对于单个值使用格式key="value" ;对于列表则使用以下结构
<pre>
<pre>
list={
list={
第64行: 第70行:
</pre>
</pre>


=== Keys ===
=== ===
The table below describes the keys available for use within the .mod file.
下表描述了可在.mod 文件中使用的键。


{| class="wikitable"
{| class="wikitable"
! Keys
!
! Required?
! 是否必需
! Description
! 描述
! Example
! 示例


|-
|-
| name
| name
| Yes
|
| Determines the name that shows up in the launcher.
| 用于确定启动器中显示的名称。
| name="My Mod"
| name="My Mod"


|-
|-
| version
| version
| Yes
|
| Allows you to define a version of your mod, defined as a string.
| 允许你为你的mod定义使用版本,该键定义为一个字符串。
| version="0.0.1"
| version="0.0.1"


|-
|-
| tags
| tags
| No
|
| Sets the tags that mod is considered part of. Correlates with Steam Workshop categories.
| 设置mod被认为属于的标签。与 Steam Workshop 的类别相关联。
|
|
<pre>
<pre>
第100行: 第106行:
|-
|-
| supported_version
| supported_version
| Required for file alongside mod folder; not required for descriptor.mod
| 在mod目录里的文件是必需的;
| Defines the latest game version the mod supports; launcher will show a warning if a mod is outdated. The game uses semantic versioning (MAJOR.MINOR.PATCH). Wildcards (<code>*</code>) may be used to define a range of versions.
在descriptor.mod 中不是必需的
| 定义该mod支持的最新版本;如果mod支持版本低于游戏版本,启动器会弹出警告。CK3使用语义化版本(即主版本号. 次版本号. 修订号)。通配符<code>*</code> 可用于定义版本范围。
| supported_version="1.1.3"
| supported_version="1.1.3"


|-
|-
| path
| path
| Yes
| 在mod目录里的文件是必需的;
| Sets which folder is the mod's folder. Note that it is no longer relative to the main ''Crusader Kings III'' folder, but rather to the Crusader Kings III user folder (described above). Alternatively, one can use the entire path.
在descriptor.mod中不是必需的
| 设置哪个文件夹是mod的文件夹。注意,它不再是相对于''Crusader Kings III'' 主文件夹,而是相对于《十字军之王III》用户文件夹(如上所述)。另外,也可以使用整个路径。
|
|
* <code>path="C:/Users/Example/Documents/Paradox Interactive/Crusader Kings III/mod/my_mod"</code> (Windows)
* <code>path="C:/Users/Example/Documents/Paradox Interactive/Crusader Kings III/mod/my_mod"</code> (Windows)
第114行: 第122行:
|-
|-
| remote_file_id
| remote_file_id
| Required if uploading and updating your own Steam Workshop mod. Set automatically when mod is uploaded.
| 如果要上传和更新Steam创意工坊mod,则必需。当mod上传时,该键会自动设置。
| Must match the Steam Workshop ID of the mod. Can be found at the end of a Steam Workshop URL, such as "2220762808" in https://steamcommunity.com/sharedfiles/filedetails/?id=2220762808.
| 必须与mod的Steam Workshop ID 匹配。可以在Steam Workshop URL 的末尾找到, 例如编号"2220762808" 的mod位于 https://steamcommunity.com/sharedfiles/filedetails/?id=2220762808.
| remote_file_id="2220762808"
| remote_file_id="2220762808"


|-
|-
| picture
| picture
| No
|
| Determines the Steam icon.
| Determines the Steam icon.
| picture="thumbnail.png"
| picture="thumbnail.png"
|}
|}


=== Basic example ===
=== 基础例子 ===
The example below displays the basic contents of a .mod file. Feel free to copy and paste it for your own .mod file, remembering to change specific details to match your own mod and game version. Note that the descriptor.mod file does ''not'' require the <code>path</code> key.
下面的例子展示了一个.mod 文件的基本内容。请随意复制并粘贴到您自己的.mod 文件中,记得更改具体细节以符合您自己的mod和游戏版本。注意,descriptor.mod 文件不需要path键。
<pre>
<pre>
version="0.0.1"
version="0.0.1"
第139行: 第147行:
</pre>
</pre>


== Mod folder ==
== Mod 文件夹 ==


Files that edit the game must be put inside the mod folder and are then subsequently loaded by the game. Files often have to be put into specific folders, otherwise they may not be loaded by the game. Some general ones have been listed below:
用来编辑游戏的文件必须放在mod文件夹里面,然后再由游戏加载。这些文件往往要放在特定的文件夹里,否则可能无法被游戏加载。下面列出了一些常见的例子
{| class="wikitable"
{| class="wikitable"
! Type
! Type
第158行: 第166行:
| common\traits
| common\traits
|}
|}
For specifics, either consult the relevant modding page using the navigation box at the bottom of this page, or look in the game files (Windows/Steam: {{cite file|C:/Program Files (x86)/Steam/steamapps/common/Crusader Kings III/game}}) and copy the folder structure for a given file up to (and not including) the {{cite file|game}} folder.
具体内容,可以使用本页底部的导航框查阅相关的修改页面,或者在游戏文件中查找 (Windows/Steam: {{cite file|C:/Program Files (x86)/Steam/steamapps/common/Crusader Kings III/game}}) 并将给定文件的文件夹结构复制到(并不包含) {{cite file|game}} 文件夹中


== Tips ==
== Tips ==


* When editing your mod folder and .mod file(s), you can reload mods in the launcher to update them without restarting it. In the "Mods" section, press "Manage all mods", then "Reload installed mods". Try this if your mod is not showing up.
* 当编辑你的mod文件夹和.mod 文件时,你可以在启动器中重新加载mods来更新它们,而无需重新启动它。在 "mods " 部分,按 "Manage all mods" ,然后按 "Reload installed mods" 。如果你的mod没有显示出来,可以尝试这一操作。
* Once you have created your initial mod structure, it is highly recommended to use some form of backup system (as simple as copying your files to someplace else), or source control such as Git / Github. This will greatly help if you lose your mod files or somehow break your mod and you want to go back to an old version.
* 一旦你创建了你的初始mod结构,强烈建议你使用某种形式的备份系统(就像把你的文件复制到别的地方一样简单),或者源代码控制,比如Git / GitHub。如果你丢失了你的mod文件或以某种方式破坏了你的mod,而你又想回到一个旧的版本,这将会有很大的帮助。
* When creating your .mod file, ensure that you follow the syntax rules correctly, otherwise your mod may not show up at all. For instance, pay attention to using speech marks (<code>"</code>) where needed, especially around values like paths and names.
* 当创建你的.mod 文件时,确保你正确地遵循语法规则,否则你的mod可能根本不会显示出来。例如,注意在需要的地方使用引号("" ),尤其是在路径和名称等值的周围。
* Check spelling everywhere, including the contents and names of files and folders. Even the simplest of errors cause the greatest problems.
* 检查所有地方的拼写,包括文件和文件夹的内容和名称。即使是最简单的错误也会造成很大的问题。


{{Modding navbox}}
{{Modding navbox}}
[[Category:模组制作]]
[[Category:模组制作]]
[[en:Mod structure]]
[[en:Mod structure]]

2024年1月21日 (日) 23:00的最新版本

Mods文件位于 ~\Paradox Interactive\Crusader Kings III\mod 文件夹中

  • Windows下的默认路径: %USERPROFILE%\Documents\Paradox Interactive\Crusader Kings III\mod
  • Linux下的默认路径: ~/.local/share/Paradox Interactive/Crusader Kings III/mod

每个mod需要两个部分:

  • 一个.mod后缀的纯文本文件,包含使用该mod所需的元数据
  • 一个mod文件夹(或.zip文件),包含此mod对游戏的修改内容,如事件、图像、决议和角色

两部分都必须位于上面的文件夹中,并且共享相同的名称,但文件扩展名除外;否则,游戏启动器将无法识别mod。请注意,文件夹和文件名在Mac和Linux上是区分大小写的。

创建初始文件[编辑 | 编辑源代码]

为了更为便捷以及避免人为错误,建议通过游戏启动器生成初始mod文件。

  1. 打开游戏启动器。
  2. 通过滚动或按“开始游戏”按钮下的 "Mod "标签,导航到 "Mods "部分。
  3. 点击"Mod工具 "按钮。
  4. 点击 "创建mod "按钮。
  5. 在这里,你可以创建你的mod,包括名称、版本(mod版本,而非游戏)、目录(将始终位于上述游戏的mod文件夹中)和任意标签。启动器提供的标签包括:
Alternative History Historical
Balance Map
Bookmarks Portraits
Character Focuses Religion
Character Interactions Schemes
Culture Sound
Decisions Total Conversion
Events Translation
Fixes Utilities
Gameplay Warfare
Graphics

也可以通过回到 "Mod工具 "菜单,然后在下拉列表中选择你的mod来更改建议的游戏版本、缩略图和描述(显示在创意工坊里)。

这个过程将创建以下内容。

  • mod文件夹,以你的mod命名。
  • 一个descriptor.mod文件,包含在mod文件夹内。
  • 另一个.mod文件,这个文件以mod命名,位于mod文件夹旁边。

*.mod 文件[编辑 | 编辑源代码]

游戏使用的.mod文件是纯文本文件,其中包含了相应mod的元数据。每个mod都有两个.mod文件。

  • (modname).mod,位于mod的文件夹旁边。这个是必须的,没有它,启动器将无法识别mod。
  • descriptor.mod,位于mod文件夹内。建议这个文件和其他文件保持一致,删除文件中包含path键的行,因为这一行并不需要出现在描述文件中

语法[编辑 | 编辑源代码]

与其他游戏文件类似,单行注释可以使用哈希(#)开始。要将一个值设置为一个键,对于单个值使用格式key="value";对于列表则使用以下结构

list={
	"element0"
	"element1"
	"element2"
}

[编辑 | 编辑源代码]

下表描述了可在.mod文件中使用的键。

是否必需 描述 示例
name 用于确定启动器中显示的名称。 name="My Mod"
version 允许你为你的mod定义使用版本,该键定义为一个字符串。 version="0.0.1"
tags 设置mod被认为属于的标签。与 Steam Workshop 的类别相关联。
tags={
	"Culture"
	"Decisions"
	"Fixes"
}
supported_version 在mod目录里的文件是必需的;

在descriptor.mod中不是必需的

定义该mod支持的最新版本;如果mod支持版本低于游戏版本,启动器会弹出警告。CK3使用语义化版本(即主版本号.次版本号.修订号)。通配符*可用于定义版本范围。 supported_version="1.1.3"
path 在mod目录里的文件是必需的;

在descriptor.mod中不是必需的

设置哪个文件夹是mod的文件夹。注意,它不再是相对于Crusader Kings III主文件夹,而是相对于《十字军之王III》用户文件夹(如上所述)。另外,也可以使用整个路径。
  • path="C:/Users/Example/Documents/Paradox Interactive/Crusader Kings III/mod/my_mod" (Windows)
  • path="/home/example/.local/share/Paradox Interactive/Crusader Kings III/mod/my_mod" (Linux)
  • path="mod/my_mod" (Relative, any OS)
remote_file_id 如果要上传和更新Steam创意工坊mod,则必需。当mod上传时,该键会自动设置。 必须与mod的Steam Workshop ID匹配。可以在Steam Workshop URL的末尾找到, 例如编号"2220762808"的mod位于 https://steamcommunity.com/sharedfiles/filedetails/?id=2220762808. remote_file_id="2220762808"
picture Determines the Steam icon. picture="thumbnail.png"

基础例子[编辑 | 编辑源代码]

下面的例子展示了一个.mod文件的基本内容。请随意复制并粘贴到您自己的.mod文件中,记得更改具体细节以符合您自己的mod和游戏版本。注意,descriptor.mod文件不需要path键。

version="0.0.1"
tags={
	"Culture"
	"Decisions"
	"Fixes"
}
name="My Mod"
supported_version="1.1.3"
path="mod/my_mod"

Mod文件夹[编辑 | 编辑源代码]

用来编辑游戏的文件必须放在mod文件夹里面,然后再由游戏加载。这些文件往往要放在特定的文件夹里,否则可能无法被游戏加载。下面列出了一些常见的例子

Type Folder
Events events
Decisions common\decisions
Defines common\defines
Traits common\traits

具体内容,可以使用本页底部的导航框查阅相关的修改页面,或者在游戏文件中查找 (Windows/Steam: C:/Program Files (x86)/Steam/steamapps/common/Crusader Kings III/game) 并将给定文件的文件夹结构复制到(并不包含) game 文件夹中

Tips[编辑 | 编辑源代码]

  • 当编辑你的mod文件夹和.mod文件时,你可以在启动器中重新加载mods来更新它们,而无需重新启动它。在 "mods "部分,按 "Manage all mods",然后按 "Reload installed mods"。如果你的mod没有显示出来,可以尝试这一操作。
  • 一旦你创建了你的初始mod结构,强烈建议你使用某种形式的备份系统(就像把你的文件复制到别的地方一样简单),或者源代码控制,比如Git / GitHub。如果你丢失了你的mod文件或以某种方式破坏了你的mod,而你又想回到一个旧的版本,这将会有很大的帮助。
  • 当创建你的.mod文件时,确保你正确地遵循语法规则,否则你的mod可能根本不会显示出来。例如,注意在需要的地方使用引号(""),尤其是在路径和名称等值的周围。
  • 检查所有地方的拼写,包括文件和文件夹的内容和名称。即使是最简单的错误也会造成很大的问题。