trigger · has_country_custom_difficulty_setting
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Returns true if the game has any custom difficulty on the scope nation
has_country_custom_difficulty_settingCOUNTRYanyReturns true if the game has any custom difficulty on the scope nation
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
这个 trigger 常用于自定义难度系统相关的 mod 场景中,例如当玩家为某个国家开启了自定义难度选项后,动态调整该国的科研速度、工厂产出或 AI 行为。也可以用在 focus 或 decision 的 available 块中,限制某些强力选项仅在标准难度下才能触发。
# 在某个国家事件的 trigger 中,检测是否启用了自定义难度
country_event = {
id = my_mod.1
trigger = {
has_country_custom_difficulty_setting = yes
# 只有开启了自定义难度的国家才会触发此事件
}
...
}
[has_country_flag](/wiki/trigger/has_country_flag):先用 flag 记录玩家对难度的选择行为,再结合本 trigger 双重确认状态,避免误判。[has_active_rule](/wiki/trigger/has_active_rule):自定义难度往往伴随特定规则的开关,两者配合可以精确区分多种难度配置组合。[add_ideas](/wiki/effect/add_ideas):检测到自定义难度后,通过添加 idea 来动态平衡国家属性,是最常见的后续效果写法。[country_event](/wiki/effect/country_event):确认自定义难度生效后触发专属事件,向玩家提示当前难度状态或给予特殊奖惩。limit 块嵌套层级较深时忘记切换 scope。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.
This trigger is commonly used in mod scenarios related to custom difficulty systems. For example, after a player enables custom difficulty options for a nation, you can dynamically adjust that nation's research speed, factory output, or AI behavior. It can also be used in the available block of a focus or decision to restrict certain powerful options to only trigger on standard difficulty.
# Check whether custom difficulty is enabled in a country event trigger
country_event = {
id = my_mod.1
trigger = {
has_country_custom_difficulty_setting = yes
# Only countries with custom difficulty enabled will trigger this event
}
...
}
[has_country_flag](/wiki/trigger/has_country_flag): Use flags to record player difficulty choices first, then combine with this trigger for dual confirmation to avoid false positives.[has_active_rule](/wiki/trigger/has_active_rule): Custom difficulty often comes with specific rule toggles; using both together allows precise differentiation between multiple difficulty configuration combinations.[add_ideas](/wiki/effect/add_ideas): After detecting custom difficulty, dynamically balance nation attributes by adding ideas—this is the most common follow-up effect pattern.[country_event](/wiki/effect/country_event): After confirming custom difficulty takes effect, trigger exclusive events to notify players of the current difficulty state or grant special rewards/penalties.limit blocks.