The basics of CD2
CD2 基础知识
The CD2 GUI(CD2 界面)
CD2 features a simple GUI compatible with both ModHub and UUI:
CD2 提供了一个简单的操作界面,兼容 ModHub 和 UUI(Unified UI)。
Modhub 中的 CD2 主界面。
The files for your difficulties can be pasted and edited in the text box. After clicking Save, the file will be saved based on the name in the Name top level field; if the file already existed, it will be overwritten. Difficulties get saved inside your mod config. You can check all your difficulties by clicking on the drop-down menu.
你的难度可以在文本框中粘贴或编辑。点击Save后,该难度会根据顶层字段 name 后面的部分命名保存。如果同名难度已存在,则会覆写旧难度。你保存的难度均存于模组配置中,可以通过下拉菜单查看。
The Reset button sets a difficulty as a default upon starting the game.
Reset 会将当前难度设为游戏启动时的默认难度。
The CD2 files (CD2难度文件要求)
- CD2 files are in the JSON format.
- CD2 文件使用 JSON 格式。
- CD1 files are not compatible with CD2.
- CD1 难度文件与 CD2 不兼容。
- The top level fields of the file are modules with different functionalities.
- 顶层模块部分为具有不同功能Modules(模块部分)
- If a module or a field is missing from a CD2 file, the value from the
BaseHazardfor the file is taken. TheBaseHazardcan be specified inside theDifficultySettingmodule. If none is specified, the base hazard is Hazard 5. - 如果 CD2 文件中缺少某个模块或字段,则会使用 BaseHazard 中的默认值。BaseHazard 可以在 DifficultySetting 模块中指定。如果未指定,则默认使用 Hazard 5。
- A file that is just
{}represents vanilla Hazard 5. - 一个内容仅为
{}的文件就代表原版 Hazard 5。 - Most fields that admit floats or ints accept also an array of the same type:
- 大多数接受浮点数或整数的字段,也可以接受相同类型的数组:
{
"Caps": {
"MaxActiveEnemies": [90, 120, 180, 180]
}
}
which means that MaxActiveEnemies scales with the number of players, 1 to 4, with the values specified inside. The arrays can be as large as desired to accomodate for 4+ player lobbies:
例如上面这个例子,MaxActiveEnemies 会随着玩家人数(1~4人)变化,依次使用数组中的数值。你也可以拓展这个数组,以适应4人以上的情况:
{
"Caps": {
"MaxActiveEnemies": [90, 120, 180, 180, 210, 210, 240, 240]
}
}
If the lobby has more players than indices in the array, the last value is used.
如果玩家人数超过数组长度,则会使用数组的最后一个值。
- Most fields can change based on gameplay conditions using mutators. The best way to learn how to use them is to look at already existing difficulties and trying to understand what they do.
- 大多数字段都可以使用 Mutators 根据游戏条件动态变化。最好的学习方法是参考别人已经写好的难度文件来理解它们是怎么运用的。
The following is a very simple file for Hazard 5x2, that is, vanilla Hazard 5 with double enemies and a 60 nitra resupply cost:
下面是一个 5x2难度的实例,即在5级难度的基础上,让敌人数量翻倍,且补给消耗为60n:
{
"Name": "Hazard 5x2",
"Caps": {
"MaxActiveSwarmers": [ 90, 120, 180 ],
"MaxActiveEnemies": [ 90, 120, 180 ]
},
"Resupply": {
"Cost": 60
},
"DifficultySetting": {
"BaseHazard": "Hazard 5",
"EnemyCountModifier": [ 1.7, 1.7, 2.5, 3 ]
}
}