Wiki

trigger · has_any_custom_difficulty_setting

Definition

  • Supported scope:any
  • Supported target:any

Description

Returns true if the game has any custom difficulty on

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

在制作自定义难度系统或成就解锁限制时,可以用此 trigger 检测玩家是否开启了任何自定义难度选项,从而决定是否禁用特定事件、成就或 UI 提示。例如,当玩家修改了难度设置时,屏蔽某些作弊性质的 mod 功能:

available = {
    NOT = { has_any_custom_difficulty_setting = yes }
}

配合关系

  • [has_custom_difficulty_setting](/wiki/trigger/has_custom_difficulty_setting):前者检测"是否存在任意自定义难度",后者检测具体的某一项难度设置,二者常配合使用做分级判断。
  • [game_rules_allow_achievements](/wiki/trigger/game_rules_allow_achievements):两者经常同时出现在成就解锁条件中,共同确保玩家没有通过任何方式降低挑战性。
  • [is_ironman](/wiki/trigger/is_ironman):Ironman 模式与难度设置紧密相关,组合使用可精确筛选出"标准铁人挑战"玩家群体。
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):当因自定义难度导致某功能不可用时,配合此 effect 向玩家展示友好的提示信息。

常见坑

  1. 混淆两个 trigger 的用途:新手容易将 has_any_custom_difficulty_setting(检测是否存在任意自定义难度)与 has_custom_difficulty_setting(检测特定某项难度设置)搞混,导致条件判断范围过宽或过窄。
  2. 忘记取反逻辑:此 trigger 返回 yes 表示"已开启自定义难度",若想在"纯净难度"下触发效果,必须用 NOT = { has_any_custom_difficulty_setting = yes } 包裹,直接写 has_any_custom_difficulty_setting = no 是错误用法。

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

When creating custom difficulty systems or achievement unlock restrictions, you can use this trigger to detect whether the player has enabled any custom difficulty options, thereby deciding whether to disable specific events, achievements, or UI prompts. For example, blocking certain mod features with exploitative potential when the player modifies difficulty settings:

available = {
    NOT = { has_any_custom_difficulty_setting = yes }
}

Synergy

  • [has_custom_difficulty_setting](/wiki/trigger/has_custom_difficulty_setting): The former detects "whether any custom difficulty exists," while the latter detects a specific difficulty setting. Both are commonly used together for tiered judgment logic.
  • [game_rules_allow_achievements](/wiki/trigger/game_rules_allow_achievements): These two frequently appear together in achievement unlock conditions to ensure the player has not reduced challenge difficulty through any means.
  • [is_ironman](/wiki/trigger/is_ironman): Ironman mode is closely related to difficulty settings. Combined usage allows precise filtering of the "standard ironman challenge" player base.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): When certain features become unavailable due to custom difficulty settings, use this effect in conjunction to display user-friendly messages to the player.

Common Pitfalls

  1. Confusing the purpose of the two triggers: Beginners often mix up has_any_custom_difficulty_setting (detecting whether any custom difficulty exists) with has_custom_difficulty_setting (detecting a specific difficulty setting), resulting in condition judgment ranges that are either too broad or too narrow.
  2. Forgetting to negate the logic: This trigger returns yes when "custom difficulty is enabled." If you want to trigger effects under "vanilla difficulty," you must wrap it with NOT = { has_any_custom_difficulty_setting = yes }. Writing has_any_custom_difficulty_setting = no directly is incorrect usage.