trigger · difficulty
Definition
- Supported scope:
any - Supported target:
none
Description
check if the difficulty is above or below specified value 0-2 (difficulty enum). Example: difficulty > 0 (above easy)
difficultyanynonecheck if the difficulty is above or below specified value 0-2 (difficulty enum). Example: difficulty > 0 (above easy)
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
difficulty 常用于根据玩家当前难度自动调整 mod 平衡性,例如在较高难度下给 AI 额外加成,或在较低难度下解锁辅助性 tooltip 提示。也可用于成就/生涯系统中限制特定奖励只在较高难度下才能触发。
# 仅在普通难度及以上时,AI 才能获得某项特殊决议
available = {
difficulty > 0
}
[is_ironman](/wiki/trigger/is_ironman):铁人模式与高难度往往同时出现,两者配合可精确限定"硬核玩法"下才开放的内容。[has_game_rule](/wiki/trigger/has_game_rule):自定义游戏规则可与难度共同构成复合条件,精细控制不同难度+规则组合下的行为。[is_historical_focus_on](/wiki/trigger/is_historical_focus_on):历史模式与难度等级组合使用,可区分"历史+困难"等特定玩法场景。[custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):当 difficulty 用在隐藏逻辑中时,配合此 effect 向玩家展示与难度相关的说明文本,提升 mod 可读性。difficulty > 1 误读为"大于普通",实际应结合官方描述中 0-2 的枚举含义仔细对应,写错比较符号(如用 = 代替 > 或 <)会导致条件永远不匹配。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.
difficulty is commonly used to automatically adjust mod balance based on the player's current difficulty level, such as granting AI bonuses at higher difficulties or unlocking helpful tooltips at lower difficulties. It can also be used in achievement/career systems to restrict specific rewards so they only trigger at higher difficulty levels.
# Only allow AI to access a certain special decision at Normal difficulty and above
available = {
difficulty > 0
}
[is_ironman](/wiki/trigger/is_ironman): Ironman mode and high difficulty often appear together; combining them allows precise control over content that only unlocks in "hardcore" playstyles.[has_game_rule](/wiki/trigger/has_game_rule): Custom game rules can be combined with difficulty to form compound conditions, providing fine-grained control over behavior across different difficulty + rule combinations.[is_historical_focus_on](/wiki/trigger/is_historical_focus_on): Using historical mode together with difficulty levels lets you distinguish specific playstyle scenarios such as "historical + hard".[custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): When difficulty is used in hidden logic, pair it with this effect to display difficulty-related explanatory text to players, improving mod readability.difficulty > 1 as "greater than normal"; you should carefully cross-reference with the official documentation's 0-2 enumeration meanings. Using the wrong comparison operator (e.g., = instead of > or <) will cause the condition to never match.