Wiki

trigger · core_resistance

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Compares the core (average of all occupied states) resistance value of occupied_country_tag that is occuppied by the country in current scope.
Example:
core_resistance = { 
 occupied_country_tag = ITA 
 value > 35 
}

实战 · 配合 · 坑

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

实战用法

core_resistance 常用于占领系统相关的 mod 场景,例如当占领国核心地区的平均抵抗值过高时,触发某些惩罚性决议或事件,迫使玩家加强镇压或调整占领政策。也可以用在 AI 策略条件判断中,让 AI 在抵抗值过低时解锁额外的扩张行动。

# 当本国占领意大利的核心州平均抵抗值超过 35 时,触发警告事件
country_event = {
    id = occupation.001
    trigger = {
        core_resistance = {
            occupied_country_tag = ITA
            value > 35
        }
    }
}

配合关系

  • [core_compliance](/wiki/trigger/core_compliance):两者互为"镜像",抵抗值高时合规度往往偏低,常并列使用来精确筛选占领状态处于临界区间的情况。
  • [any_occupied_country](/wiki/trigger/any_occupied_country):用于先遍历所有被占领国,再在内层用 core_resistance 筛选出特定抵抗程度的国家,实现批量条件判断。
  • [has_core_occupation_modifier](/wiki/trigger/has_core_occupation_modifier):判断是否已存在某占领修正,与 core_resistance 配合可避免重复添加同一修正。
  • [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier):当 core_resistance 判断为真时,通过该 effect 向占领国施加动态修正(如战斗效率惩罚),构成"条件→后果"的完整逻辑链。

常见坑

  1. occupied_country_tag 填写错误或遗漏:该字段是必填的,若省略或填写了当前 scope 自身的 tag,脚本将无法正确计算被占领国核心州的平均抵抗值,导致条件始终不触发或报错,务必确认填写的是被占领方的国家 tag。
  2. 误解"平均值"的计算范围:此 trigger 统计的是被占领国所有被当前国家占领的核心州的平均抵抗值,而非单一州或全部州,新手容易与针对单个州的抵抗触发器混淆,导致阈值设定与实际游戏表现不符。

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

core_resistance is commonly used in occupation system–related mod scenarios. For example, you can trigger certain punitive decisions or events when the average resistance value of occupied core territories exceeds a threshold, forcing players to strengthen suppression or adjust occupation policies. It can also be used in AI strategy condition checks, allowing the AI to unlock additional expansion actions when resistance falls below a certain level.

# Trigger a warning event when this country's average core resistance in occupied Italian states exceeds 35
country_event = {
    id = occupation.001
    trigger = {
        core_resistance = {
            occupied_country_tag = ITA
            value > 35
        }
    }
}

Synergy

  • [core_compliance](/wiki/trigger/core_compliance): These two are "mirror" opposites—high resistance typically correlates with low compliance. They are often used together to precisely filter occupation states within critical ranges.
  • [any_occupied_country](/wiki/trigger/any_occupied_country): Used to iterate through all occupied countries first, then filter specific resistance levels within the inner scope using core_resistance, enabling batch condition evaluation.
  • [has_core_occupation_modifier](/wiki/trigger/has_core_occupation_modifier): Checks whether a specific occupation modifier already exists. Combined with core_resistance, it prevents duplicate application of the same modifier.
  • [add_dynamic_modifier](/wiki/effect/add_dynamic_modifier): When core_resistance evaluates to true, use this effect to apply dynamic modifiers to the occupying country (such as combat efficiency penalties), forming a complete "condition → consequence" logic chain.

Common Pitfalls

  1. Incorrect or missing occupied_country_tag: This field is mandatory. If omitted or filled with the current scope's own tag, the script will fail to correctly calculate the average resistance of the occupied country's core states, causing the condition to never trigger or produce errors. Always verify that you are specifying the occupied party's country tag.
  2. Misunderstanding the calculation scope of "average": This trigger calculates the average resistance value across all core states of the occupied country that are currently occupied by your country, not a single state or all states globally. Beginners often confuse this with single-state resistance triggers, leading to threshold settings that do not match actual in-game behavior.