Modules(模块)

Modules are the top level hierarchy names for a valid CD2 JSON. The following is an alphabetized list of the current modules.

模块是有效 CD2 JSON 配置文件中的顶层字段名称。以下列出了当前可用的所有模块(按字母顺序排列)。

Caps(虫量上限)

Control for the maximum number of enemies in the map, with the following fields:

控制地图中敌人数量的多少,包含以下字段:

Field Type
MaxActiveCritters最大非敌对生物数量 Int
MaxActiveEnemies最大大型生物数量 Int
Max Active Swarmers最大小型生物数量 Int

Example:

示例:

"Caps": {
    "MaxActiveCritters": 40,
    "MaxActiveSwarmers": [90, 120, 180, 180],
    "MaxActiveEnemies": [90, 120, 180, 180]
}

When the number of enemies in the map reach their cap, new enemies will be prevented from spawning and some existing enemies will despawn. The exact mechanics behind this behaviour are not completely understood.

当地图中的敌人数量达到上限后,新敌人生成将无法生成,并且部分已有敌人可能会被移除,具体的机制尚未完全明确

Darkness(光照控制)

The Darkness module offers controls related to lighting and illumination both in the Space Rig and during a mission. It has the following fields (descriptions provided by @noskill):

Darkness 模块用于控制太空站与任务中照明与光照,包含以下字段。(描述来自@noskill)

Field Type Default Comment
FlashlightStrength手电筒亮度 Float 1? Headlight light strength, affects both range and strength of the light.手电筒,影响光照范围与亮度。
PlayerIllumination玩家自带光源 Float 1? Light strength in a radius around the player. Only affects strength and not radius.玩家周围半径内的光照强度,仅影响亮度,不影响范围。
FlareMax最多荧光棒数量 Int 4 Maximum number of flares that the player can keep.玩家能携带的最大荧光棒数量。
FlareStrength荧光棒亮度 Float 1? Strength of the flares, affects both radius and strength. Seems no have no effect above 3.荧光棒的光照强度与范围,超过 3 无明显变化。
FlareDuration荧光棒持续时间 Float 30 Duration of the player flares.玩家荧光棒发光的持续时间。
FlareProductionTime荧光棒冷却时间 Float 12 Recharge time of the player's flares. It has been noted that changing this setting while in-game could cause flares to get stuck and not recharge.玩家荧光棒的冷却时间,注意:不建议在任务中修改。
EnvironmentalLight环境光照 Float 1? Environmental (cave) light. Affects both radius and strength.洞穴环境光亮度,影响光照范围和亮度。
DisableFog禁用迷雾 Bool False Removes "fog", making the caves look darker. It seems that after disabling it in-mission it can't be enabled again.禁用迷雾,使洞穴看起来更暗。在任务中禁用后,似乎无法再次启用。
FlareGunStrength侦察照明弹亮度 Float 1? Strength of Scout's flare gun flares.侦察照明弹的光照强度
FlareGunDuration侦察照明弹持续时间 Float Depends on flare gun stats Duration of Scout's flare gun flares.侦察照明弹的发光持续时间。

Description(描述)

A short explanation of the difficulty.

Description 用于简要说明该难度

Example:

比如:

{
    "Description": "Hazard 6 with double enemies."
}

DifficultySetting(难度设置)

Main controls for enemy resistance, swarm and wave intervals and enemy counts.

“DifficultySetting”模块主要用于控制敌人抗性、虫潮间隔和敌人数量等核心因素。

The descriptions here are very summarized, please check A Quick and Dirty Guide to Custom Difficulty for Deep Rock Galactic, a CD1 guide explaining most of the fields inside this module foe details.

此处说明比较简略,详情请参考《深岩银河自定义难度快速入门》,一份基于 CD1编写的指南,解释了了本模块中的大部分字段(因为cd1和这个地方大致一样)

To see the values of these fields for the vanilla Hazards and some others, please check the DRG Hazard Scaling file.

若要查看原版难度及其他的一些难度(如6级、7级),请查阅《DRG Hazard Scaling》这个文件[Resource里面]

Field Description
BaseHazard基础难度(如使用难度5的值为基础) Declares a base vanilla hazard, with values from 1 to 5. When a CD2 JSON doesn't specify a certain field, the value is taken from the BaseHazard specified here.
ExtraLargeEnemyDamageResistance 无畏、看守者抗性 Affects the damage resistance of the three dreadnought variants.
ExtraLargeEnemyDamageResistanceB 王草抗性 Affects the damage resistance of the Korlok Tyrant Weed.
ExtraLargeEnemyDamageResistanceC 除虫器抗性 Affects the damage resistance of the OMEN Tower.
ExtraLargeEnemyDamageResistanceD 精英抗性 Affects the damage resistance of Elite enemies.
EnemyDamageResistance 普通敌人抗性 Damage resistance of most larger enemies in the game: praetorians, oppressors, menaces, goo bombers, bulk detonators, etc.
SmallEnemyDamageResistance 小型敌人抗性(包括不限于战士三兄弟) Damage resistance of everything not covered by the other resistance fields: grunts, mactera, swarmers, etc.
EncounterDifficulty 遭遇潮点数 Difficulty of the encounters, waves that appear when the players come within a certain distance of an unexplored cave.
StationaryDifficulty 固定点数 How many stationary enemies will spawn.
EnemyCountModifier 敌人数量 A global multiplier on the number of enemies that will spawn in waves, swarms, constant pressure, extraction, among others.
EnemyWaveInterval 播报潮间隔 Interval in seconds between swarms (announced).
EnemyNormalWaveInterval 自然潮间隔 Interval in seconds between normal (non-announced) waves.
EnemyNormalWaveDifficulty 自然潮点数 How many enemies will spawn in a normal wave.
EnemyDiversity 敌人多样性 Determines how many enemies will spawn in a given spawn event, given an EnemyPool.
StationaryEnemyDiversity 固定敌人多样性 Enemy diversity roll for stationary enemies (everything in the StationaryPool).
VeteranNormal 小型敌人变异率 Percentage of Grunt and Mactera veterans promoting from the non-veteran variants.
VeteranLarge 大型敌人变异率 Percentage of Oppressors promoting to veterans from Praetorians.
EnviromentalDamageModifier 环境伤害
PointExtractionScalar Interval between swarms in Point Extraction, taking effect after the first swarm. The value is capped at 1 and the formula seems to be Interval = 165/ PointExtractionScalar.
FriendlyFireModifier 友伤系数 How much friendly fire players deal to each other.
WaveStartDelayScale 播报潮延迟 Adds (or subtracts) a delay for the first swarm in a mission. The delay in seconds will be 150 · WaveStartDelayScale. The default is zero; if negative (eg. -1), a swarm will spawn directly at mission start.
SpeedModifier 敌人移速 Global modifier affecting the speed of ground enemies. Mactera are unaffected.
AttackCooldownModifier 敌人攻速 Global modifier affecting the speed of enemy attack animations.
ProjectileSpeedModifier 敌人发射物速度 Global modifier affecting the speed of all projectiles.
HealthRegenerationMax 残血后最大回血比例(若该比例足够高,则可做到呼吸回血) Maximum health that the dwarves regenerate naturally to.
ReviveHealthRatio 复活后回血比例 Health points after revive.

Dwarves(矮人属性)

Offers some controls related to the players.

提供与玩家有关的一些参数。

Field Default Description
FallDamageModifier 摔落伤害 Default: 0.175
FallDamageStartVelocity 开始计算摔落伤害的速度 Default: 1000 Multiplier for player shield capacity.
RegenHealthPerSecond 每秒回复血量
RegenDelayAfterDamage 受致命伤后回复延迟
Scale 玩家体型比例 Player size.

Enemies / EnemiesNoSync(敌人配置[客服端同步/不同步])

See the Enemies/EnemiesNoSync section.

详情见Enemies/EnemiesNoSync部分

EscortMule(护送任务)

Controls for the Drilldozer in Escort missions.

控制护送任务重 朵朵属性 的字段部分

Field Type Default Comments
HealPerTickNormal 每刻回血量 Float 13 Currently unsupported.
HealPerTickUnderAttack 被攻击时每刻回血量 Float 4.5 Currently unsupported.
MaxAttackersOmoranFight 心石阶段最多攻击朵朵虫量? Float 6 Currently unsupported.
MaxHealth 最大血量 Float 520 Currently unsupported.
FriendlyFireModifier 友伤系数 Float 0.1
NeutralDamageModifier 中立生物伤害系数 Float 0.1
BigHitDamageModifier 减伤系数 Float 0.5
BigHitDamageReductionThreshold 减伤判定阈值 Float 6
PST_PoisonResistance 毒抗 Float 0.25 Currently unsupported.
PST_RadiationResistance 辐射抗性 Float 0.5 Currently unsupported.
PST_ExplosionResistance 爆炸抗性 Float 0.5 Currently unsupported.

MaxPlayers(最多玩家数)

A field accepting an int specifying the maximum number of players allowed in the lobby.

一个整数字段,用于设定大厅允许的最大玩家数

{
    "MaxPlayers": 16
}

Messages(信息)

A module that allows CD2 to send messages to chat in response to events happening during the mission. It has The following fields:

该模块允许 CD2 在任务期间发生某些事件时,向聊天框发送信息。它包含以下字段:

Field Type Default Description
Send 发送条件 Boolean False Send chat message when true
SendOnChange Boolean False Send chat message when another value (e.g. message) changes 当另一个值发生变化时发送消息(例如:倒计时性质的消息)
Type 发送人类别 String Game Options: Game, Normal, Delux, Developer, Streamer, Modder
Sender 发送人名称 String CD2 Name of the Sender
Message 发送的消息 String

Examples:

示例:

The following snippet sends a message on chat when the next resupply is available.

以下字段会在下一次补给可用时发送消息:

...,
"Messages": [
    {
      "Message": "!!! Resupply Available !!!",
      "Send": {
        "Mutate": "IfFloat",
        "Value": {
          "Mutate": "DepositedResource",
          "Resource": "Nitra"
        },
        ">=": 60,
        "Then": true,
        "Else": false
      }
    }
],
...

The following snippet sends a message on chat when a player dies.

以下字段会在有玩家死亡时发送消息:

...,
"Messages": [
    {
      "Send": {
        "Mutate": "TriggerOnChange",
        "RiseOnly": true,
        "Value": {
          "Mutate": "DwarvesDown"
        }
      },
      "Type": "Delux",
      "Sender": "Karl",
      "Message": {
        "Mutate": "RandomChoice",
        "Choices": [
          "Stop Dying",
          "Skill Issue"
        ]
      }
    }
],
...

Name(名称)

The name of the difficulty. This field is necessary to be able to save the file in the in-game CD2 dropdown. Example:

难度名称。此字段为必填项,用于在游戏内 CD2 下拉菜单中识别并保存该配置。例如:

{
    "Name": "Hazard 6x2 40 nitra"
}

NextDifficulty(Next难度)

NextDifficulty allows CD2 to automatically pick another difficulty at two specific moments:

允许 CD2 在两个特定时刻自动选择另一个难度

  1. When launching a mission from the space rig.
  2. 在太空站台开始任务时,

  3. When a mission is finished.
  4. 在任务完成后。

There are many different uses for this field but a typical application is, using the RandomChoice mutator, choosing a difficulty at random when launching a mission:

该字段有很多不同的用途,比较典型的是使用 RandomChoice 的 MUTATOR ,在启动任务时随机选择一个难度

{ 
 "Name": "Difficulty Roulette", 
 "NextDifficulty": {
  "Mutate": "RandomChoice",
  "Choices": ["6x2", "6x2-ultra", "7x2", "DIIa8", "ND"]
 }
}

Where it is understood that all the names in the Choices field are other difficulties existing in your CD2 list. The same snippet can be used to change the difficulty at random in deep dive stages.

Choices 字段中列出的名称,必须是 CD2 难度列表中已存在的其他难度。相同的配置片段也可用于 深潜阶段,以实现随机切换难度。

If you don't want the difficulty to change when launching a mission from the Space Rig, the IfOnSpaceRig mutator can be used as follows:

如果你不希望从太空站启动任务时难度发生变化,可使用 IfOnSpaceRig Mutator,示例如下:

{
  "NextDifficulty": {
    "Mutate": "IfOnSpaceRig",
    "Then": "",
    "Else": "My Next Difficulty"
  }
}

Different difficulties in every stage of a Deep Dive每个深潜阶段的不同难度,

This is a common application of NextDifficulty allowing to mimic the increasing difficulty of the vanilla Deep Dive with whatever set of three difficulties you choose. The way to set it up is as follows: let's say that we want to play Hazard 5x2 on Stage 1, Hazard 6x2 on Stage 2 and ND on Stage 3. We will need the three files saved in Custom Difficulty, and then we would add the following to each:

这是 NextDifficulty的一个常见应用,通过使用你选择的三个难度,来模仿原版深潜中逐渐增加的难度。设置方法如下:假想你想在第一阶段玩 5*2,第二阶段玩6*2,第三阶段玩ND(一个国外社区的难度)。我们需要将这三个文件保存在 CD2 中,然后分别为每个文件添加以下内容:

{
    "Name": "Hazard 5x2",
    ...
    "NextDifficulty": "Hazard 6x2",
    ...
}
{
    "Name": "Hazard 6x2",
    ...
    "NextDifficulty": "ND",
    ...
}

The ND file, being the one played in stage 3, doesn't need any modifications. In addition to editing the files for stage 1 and 2, you will need a "starter" file:

"ND"这个文件(国外社区的一个难度,即第三阶段所使用的难度)不需要任何修改。除了编辑第一阶段和第二阶段的文件外,你还需要一个“起始文件”。

{
    "Name": "Dive Starter",
    "NextDifficulty": "Hazard 5x2"
}

This Dive Starter will be the file you will select while on the Space Rig before starting the dive, and it should point to the difficulty you want to play on the first stage.

这个 Dive Starter 文件是你在太空平台上开始深潜之前选择的文件,它应该是你想在第一阶段玩的难度。

NitraMultiplier

A special module that accepts a float and controls the amount of nitra generated in the map. It has a default of 1. The following snippet would generate twice the amount of nitra in a certain mission:

一个特殊模块,可以通过修改浮点数值来控制地图中生成的硝石数量,默认为1,以下字段会让地图生成 2 倍硝石:

{
    "NitraMultiplier": 2
}

Pools(怪池)

Pools is where enemies can be added or removed from the different pools in the game. For more information, this document is a detailed explanation about the pools system and how are they used when deciding which enemies are present in a mission. The accepted fields in Pools are:

Pools 模块是用于从游戏中的不同怪池中添加或移除敌人的地方。更多的信息请参阅文件中对怪池系统的解释,以及决定任务中出现那些敌人的原理。其接受的字段有以下内容:

Field Type
MinPoolSize Int
DisruptiveEnemyPoolCount Int (min, max)
StationaryEnemycount Int (min, max)
CommonEnemies *
SpecialEnemies 特殊敌人池 *
DisruptiveEnemies 破坏性敌人池 *
StationaryPool 固定敌人池 *
EnemyPool *

The fields marked with * accept the Add (list), Remove (list) and Clear (bool) fields for adding and removing enemies at will. The EnemyPool can be freely manipulated with mutators during the mission, opening the possibility of adding and removing enemies based on gameplay conditions. It is not recommended to mutate the other pools.

带有✳标记的字段可接受Add、Remove和Clear,用于按需添加或移除敌人。EnemyPool在任务过程中可以通过 Mutator 自由编辑,允许根据游戏条件动态添减敌人。其它池子不推荐使用 Mutator 实时更改

Example:

比如:

{
    "Pools": {
    "MinPoolSize": 30,
    "DisruptiveEnemyPoolCount": {
      "min": 8,
      "max": 8
    },
    "StationaryEnemyCount": {
      "Min": 6,
      "Max": 6
    },
    "CommonEnemies": {
      "Add": [
        "ED_JellyBreeder_Swarm",
        "ED_PatrolBot",
        "ED_Sentinel",
        "ED_Bomber_Explosive"
      ]
    },
    "StationaryPool": {
      "Add": ["ED_ShootingPlant_NukeSingle"],
      "Remove": []
    }
  }
}

Salvage 搜救行动

A special module offering customization options for Salvage missions. It contains three submodules: MiniMules, Uplink and Refuel with the following fields:

一个专为 搜救行动任务 提供自定义选项的模块,包括三个子模块:MiniMules、Uplink、Refuel,各具有以下字段

Submodule Field Type Default Description
MiniMules ScanUsable 可否扫描骡腿 Usable Settings for e holding to scan for legs
MiniMules RepairUsable 可否修骡子 Usable Settings for e holding to repair the minimule
MiniMules LegsRequired 每个骡子需要的骡腿数量 Int 3 Number of legs that must be attached before allowing repair
MiniMules LegsPerMule 每个骡子周围生成的骡腿 Int 4 Number of legs to spawn per minimule
MiniMules LegDistance 每个骡腿距离骡子的距离 Float 1500 Untested, should be distance legs spawn from the minimules
MiniMules Count 骡子总量 Int 2 Number of minimules to spawn (or 1.5x on long Salvage)
MiniMules NitraToGive 修完骡子给的硝石量 Int 50 Nitra given by the mules after repairing them
--------- ---------------------- ------ ------- --------------------------------------------------------------------------------
Uplink RepairUsable 可否激活上传 Usable Settings for holding e to activate the uplink
Uplink Scale 上传区域大小 Float 1 Size of the triangulation zone
Uplink Duration 上传需要时间 Float 80 Defense duration in seconds
Uplink ExtraDefenderBonus 额外抗性 Float 0.25
Uplink DisableLeaveShout 让上传区域没人的时候不许任务管理中心警告 Bool false Disables mission control messages when there are no players in the defense area.
Uplink LeavePenaltyMultiplier 离开上传区域掉进度的速度 Float 1 1 means vanilla penalty (2x the speed progress normally increases)
--------- ---------------------- ------ ------- --------------------------------------------------------------------------------
Refuel RepairUsable 可否交互 Usable
Refuel Scale 区域大小 Float 1 Size of the triangulation zone
Refuel Duration 所需时间 Float 100 Defense duration in seconds
Refuel ExtraDefenderBonus 额外抗性 Float 0.25
Refuel DisableLeaveShout让refuel 让上传区域没人的时候不许任务管理中心警告 Bool false
Refuel LeavePenaltyMultiplier 离开上传区域掉进度的速度 Float 1 0 means no lost progress if leaving the defense area

Example: a salvage where each mule spawns 20 legs and requires 15 to be repaired, and the area of the uplink bubble is 1.5x the normal.

示例:一次搜救行动,每个骡子生成20条腿,各自需要15条腿才能修好,且上传区域大小是正常的1.5倍

{
    "Salvage": {
       "MiniMules": {
            "LegsPerMule": 20,
            "LegsRequired": 15
        },
        "Uplink": {
            "Scale": 1.5
        }
    }
}

Another example: the number of legs is randomized every mission.

另一个示例:让每个任务中修骡需要的腿数量从数组中随机抽取。

{
    "Salvage": {
        "MiniMules": {
            "LegsRequired": {
                "Mutate": "RandomChoice",
                "Choices": [3, 4, 5, 6, 7]
            }
            "LegsPerMule": 12
        }
    }
}

Please see the BySalvagePhase mutator for values that need to change during different phases of the mission.

对于需要根据处于任务不同阶段而改变的数值,请查阅 BySalvagePhase mutator。

Usable fields

Some of the fields in the table above are marked as Usable. These affect how the E key interactions work in some instances such as mule repairing. They accept the following fields:

上述表格中被标记为 Usable的字段,会影响某些情况下 E 键交互的方式,例如修理骡子。它们接受以下字段:

Field Type Description
CoopUse 是否允许多玩家协作交互 Boolean TODO
CoopUseMultiplier 多玩家交互时的速度加成倍数 Float Increases or decreases the speed boost granted when multiple players are interacting. Defaults to 1.
Priority 交互优先级 Int Sets up the priority of the E actions.
ResetOnFail 交互失败时是否重置进度 Boolean TODO
UseText 交互时显示的文本 String TODO
UseCooldown 再次交互前的冷却时间 Float Cooldown before interaction can happen again.
UseDuration 交互所需时间 Float Duration of the E interaction.

Some examples of use. The following snippet makes the uplink repair faster than normal when more than 1 player is interacting:

使用示例:以下字段可在多个玩家参与交互时,让 Uplink的修复速度更快:

{
    "Salvage": {
        "Uplink": {
            "RepairUsable": {
                "CoopUseMultiplier": 5
            }
        }
    }
}

The following snippet changes the duration of the mule repair based on how many players are interacting, and buffs the speed boost of multiple players:

以下字段根据参与修骡的玩家数动态调整改变修理骡子的时间,并增强多人交互时加速修理速度:

{
    "Salvage": {
        "MiniMules": {
            "RepairUsable": {
                "UseDuration": {
                    "Mutate": "ByPlayerCount",
                    "Values": [10, 20, 30, 40]
                },
                "CoopUseMultiplier": 5
            }
        }
    }
}

SoundCues(声音提示)

A module that allows CD2 to play a sound in response to events happening during the mission. It has two fields: a boolean Play which accepts mutators and a Cue which accepts the path to the sound you want to play. As an example, the following snippet plays a laughing sound when a player dies:

该模块允许 CD2 在任务中发生某些事件时播放音效。它包含两个字段,Play(true/false决定是否播放,可用 Mutators 动态调整);Cue(音效文件路径)。示例:以下字段会在玩家死亡的时候嘻嘻哈哈

...,
 "SoundCues": [
    {
      "Play": {
        "Mutate": "TriggerOnChange",
        "RiseOnly": true,
        "Value": {
          "Mutate": "DwarvesDown"
        }
      },
      "Cue": "/Game/Audio/SFX/Environment/Pumpkin/Pumpkin_EvilLaughter_01_Cue.Pumpkin_EvilLaughter_01_Cue"
    }
  ],
...

The game has a lot of available sounds, but to play them outside the game you will need the game files and either Unreal Engine 4.27 or FModel.

游戏内有大量可用音效,但如果想在游戏外播放,则需要提取游戏文件,并使用 Unreal 4.27 或 FModel 工具。

SpecialEncounters(特殊遭遇事件)

This module controls the chance of some random events such as the Korlok, Bet-C, etc. Please note that this module is not 100 % functional as some of the encounters depend on the seasons system which CD2 cannot control for now. Each SpecialEncounter accepts the following fields:

该模块用于控制一些随机特殊遭遇事件(如Korlok、Bet-C等)的出现概率。请注意,该模块不能100%正常运行,因为某些遭遇依赖于 CD2 目前无法控制的赛季系统。每个SpecialEncounter接受以下字段:

Field Type
BaseChance 基础概率 Float
Enemy 敌人描述符 Descriptor
CanSpawnInDeepDive 是否能在深潜中生成 Bool

The vanilla SpecialEncounters would look like:

原版SpecialEncounters配置如下所示:

{
    "SpecialEncounters": [
    {
      "Enemy": "ED_InfectedMule",
      "BaseChance": 0.05,
      "CanSpawnInDeepDive": true
    },
    {
      "Enemy": "ED_Spider_ExploderTank_King",
      "BaseChance": 0.03,
      "CanSpawnInDeepDive": false
    },
    {
      "Enemy": "ED_HydraWeed",
      "BaseChance": 0.05,
      "CanSpawnInDeepDive": false
    },
    {
      "Enemy": "ED_Terminator",
      "BaseChance": 0.03,
      "CanSpawnInDeepDive": true
    }
  ]
}

Example: set all special encounters to zero.

示例:禁用所有特殊遭遇

{
    "SpecialEncounters": []
}

SpecialEncounters can accept any enemy descriptor in its Enemy field and it can be used to make sure there's exactly 1 such enemy for the whole mission. As an example, some difficulties have exactly 1 Vartok Scalebramble per mission:

SpecialEncounters可在其Enemy字段中接受任何敌人描述符,并可用于确保任务中固定生成一个这样的敌人。示例,某些难度每局固定生成一个小王草:

{
    "SpecialEncounters": [
        {
          "BaseChance": 1.0,
          "CanSpawnInDeepDive": true,
          "Enemy": "ED_TentaclePlant"
        }
      ]
}

Resupply(补给)

This module contains information about the resupply cost. It accepts a single float field Cost that can be mutated.

该模块包含补给消耗的设置,它仅接受一个名为 Cost 的浮点数字段(注:该字段可被 Mutator 动态调整):

Example: a fixed resupply cost of 40 nitra.

示例:只需要40n的补给

{
    "Resupply": {
        "Cost": 40
    }
}

The StartingNitra field from CD1 does not exist in CD2: the same functionality is done with mutators. Example: the first resupply is free, 40 nitra for all others:

CD1 中的 StartingNitra 字段在 CD2 中已不存在,但可通过 Mutator 实现相同功能。示例如下:第一次补给免费,后续每次消耗40n。

{
    "Resupply": {
        "Cost": {
            "Mutate": "ByResuppliesCalled",
            "Values": [0, 40]
        }
    }
}
{
    "Resupply": {
      "Cost": {
        "Mutate": "IfFloat",
        "Value": {
          "Mutate": "ResuppliesCalled"
        },
        "==": 0,
        "Then": 0,
        "Else": 40
      }
    }
}

While both snippets do the same thing, ByResuppliesCalled is usually more compact when specifying a different cost for the first few supplies.

虽然两个代码片段功能相同,但 ByResuppliesCalled 在指定前几次补给的不同费用时更简洁。

Example: the cost is 45, but after the 6th resupply it drops to 40.

示例:补给消耗 45硝石,但第 6 次之后降为 40。。

{ 
  "Resupply": {
    "Cost": {
      "Mutate": "IfFloat",
      "Value": {
        "Mutate": "ResuppliesCalled"
      },
      ">": 6,
      "Then": 40,
      "Else": 45
    }
  }
}

Vars(全局变量池)

A module to store global variables, which allow communication between modules. Vars is structured as a dictionary of names and values with the following fields:

该模块用于储存全局变量,同时支持模块间通信。它采用字典结构,每个变量包含以下字段

  • Type: the variable type. Can be one of the following: Boolean, String, Float or Strings, the latter used for arrays of String.
  • Type: 变量类型,可选类型包括 Boolean、String、Float、Strings ( Strings 表示字符串数组 )
  • Watch: a boolean which will show the variable's value in the UI for debugging.
  • Watch: 布尔字段,用于选择是否在 UI 中显示该变量的值以便调试
  • Value: the variable's value, which can be mutated.
  • Value: 变量的值,可被 Mutators 修改

A variable defined in Vars can be later used in any place which accepts a value of the same type by using {"Var": "MyVariable"}. Variables are all updated at once so they will always be consistent across modules, but the implementation can cause up to 500 ms of delay between the variable state and the true game state.

在 Vars 中定义的变量,可在任何需要对应类型值的地方通过{"Var": "MyVariable"}引用。所有变量会在同一时刻统一更新,因此模块间状态始终保持一致,但这种实现方式可能导致变量实际状态与真实游戏状态之间存在 500ms 的延迟


...,
"Vars": {
    "Debug": {
      "Type": "Boolean",
      "Value": false
    },
    "MuleDistanceToDroppod": {
      "Type": "Float",
      "Value": { "Mutate": "MuleDistanceToDroppod" },
      "Watch": { "Var": "Debug" }
    },
    "PressureDifficulty": {
      "Type": "String",
      "Value": "Medium"
    },
    "EaseOffOnDowns": {
      "Type": "Boolean",
      "Value": true
    },
    "EDs": {
      "Type": "Strings",
      "Value": ["ED_1", "ED_2", "ED_3"]
    },
    "SecondaryUnfinishedPunishment": {
      "Type": "Float",
      "Value": {
        "Mutate": "LockFloat",
        "Lock": { "Mutate": "SecondaryFinished" },
        "Value": { "Mutate": "ByTime", "RateOfChange": 0.01 }
      }
    }
},
...,

The following snippet allows the user to have a toggle for adding or removing stingtails in a difficulty:

以下代码片段允许用户通过 "Stingtails"这个变量的值 来决定是否在难度配置中添加蛭尾异虫:


...,
"Vars": {
    "Stingtails": {
        "Type": "Boolean",
        "Value": true 
    }
},
"Pools": {
    "EnemyPool": {
        "Remove": [
            {
                "Mutate": "If",
                "Condition": {"Var": "Stingtails"},
                "Then": [],
                "Else": "ED_Spider_Stinger"
            }
        ]
    }
}
...

The following snippet allows the user to select an easy or a hard version of the difficulty by using a variable for the EnemyCountModifier and the Select mutator:

以下代码片段允许用户通过 "Pressure"这个变量的值 选择难度的“简单”或“困难”版本,方法是将该变量用于 EnemyCountModifier 并配合 Select Mutator:


...,
"Vars": {
    "Pressure": {
        "Type": "String",
        "Value": "Easy"
    }
},
"DifficultySetting": {
    "EnemyCountModifier": {
        "Mutate": "Multiply",
        "BaseValues": {
            "Mutate": "ByPlayerCount",
            "Values": [1.9, 2.1, 2.7, 3.3]
        },
        "Multiplier": {
            "Mutate": "Select",
            "Select": {"Var": "Pressure"}
            "Default": 1,
            "Easy": 1, 
            "Hard": 1.3 
        }
    }
},
...

Warnings(禁用任务词条)

The Warnings module can be used to ban mission anomalies. It accepts a single Banned field which is one or more from the table below. Please note that banning anomalies that affect resource generation such as Mineral Mania or Gold Rush will cause clients without CD2 to have mineral desync and they will not be able to get nitra.

Warnings 模块可用于禁止任务词条。它接受一个 Banned 字段,其值可为下表中的一个或多个。请注意,禁用影响资源产出的词条(如矿石天堂/淘金热潮)会导致未安装 CD2 的客户端矿物数据不同步,并且无法获得硝石。

CD2 name In-game name 翻译
"MMUT_BloodSugar" Blood Sugar 凝血化糖
"MMUT_ExplosiveEnemies" Volatile Guts 易爆内脏
"MMUT_ExterminationContract" Golden Bugs 黄金虫群
"MMUT_GoldRush" Gold Rush 淘金热潮
"MMUT_LowGravity" Low Gravity 低倍重力
"MMUT_OxygenRich" Rich Atmosphere 氧气充裕
"MMUT_RichInMinerals" Mineral Mania 矿石天堂
"MMUT_SecretSecondary" Secret Secondary 神秘次要
"MMUT_Weakspot" Critical Weakness 致命弱点
"MMUT_XXXP" Double XP 双倍经验
"WRN_BulletHell" Duck and Cover 远程狂潮
"WRN_CaveLeechDen" Cave Leech Cluster 水蛭丛生
"WRN_ExploderInfestation" Exploder Infestation 自爆群袭
"WRN_Ghost" Haunted Cave 幽魂不散
"WRN_HeroEnemies" Elite Enemies 精英敌人
"WRN_InfestedEnemies" Parasites 寄生感染
"WRN_LethalEnemies" Lethal Enemies 致命虫群
"WRN_MacteraCave" Mactera Plague 异虫蝇瘟疫
"WRN_NoOxygen" Low O2 氧气稀薄
"WRN_NoShields" Shield Disruption 护盾瓦解
"WRN_Plague" Lithophage Outbreak 噬岩体爆发
"WRN_RegenerativeEnemies" Regenerative Enemies 虫群再生
"WRN_RivalIncursion" Rival Presence 强敌环伺
"WRN_RockInfestation" Ebonite Outbreak 矿化爆发
"WRN_Swarmagedon Swarmageddon 蜂拥群袭

Example: ban Swarmageddon and Low O2 from a difficulty.

示例:在难度中禁止蜂拥群袭与氧气稀薄词条。

{
    "Warnings": {
        "Banned": [
            "WRN_Swarmagedon",
            "WRN_NoOxygen"
        ]
    }
}

WaveSpawners

See the WaveSpawners section.

请查看波次生成器部分