Wiki

trigger · resistance_target

Definition

  • Supported scope:STATE
  • Supported target:any

Description

Compares the target resistance level of a state to a value. Example: resistance_target > 50

实战 · 配合 · 坑

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

实战用法

resistance_target 常用于占领管理类 mod 中,根据某个州的目标抵抗值动态触发事件或限制决议可用性,例如在敌方占领区抵抗目标过高时禁止某些镇压措施选项。它也可用于 AI 条件判断,当目标抵抗值超过某一阈值时才允许切换占领政策。

# 仅当该州目标抵抗值超过 50 时,限制某项决议可用
available = {
    resistance_target < 50
}

配合关系

  • [resistance](/wiki/trigger/resistance)resistance_target 反映的是目标值,而 resistance 反映的是当前实际抵抗强度,两者配合可精确判断抵抗趋势(目标高但当前低说明抵抗正在上升)。
  • [has_active_resistance](/wiki/trigger/has_active_resistance):先确认该州是否存在活跃抵抗,再用 resistance_target 判断其烈度,避免在无抵抗州做无效判断。
  • [add_resistance_target](/wiki/effect/add_resistance_target):与其对应的 effect,常用于在同一脚本块中先用 resistance_target 作条件检查,再决定是否调整目标值。
  • [occupation_law](/wiki/trigger/occupation_law):占领法与目标抵抗直接相关,组合使用可实现"当占领法严苛且目标抵抗过高时触发特定后果"的逻辑。

常见坑

  1. 混淆 resistance_targetresistance:新手常将两者当作同一含义来使用,实际上前者是系统计算出的抵抗"目标稳定值",后者是当前实时抵抗强度,两者可能差距较大,用错会导致条件判断时机完全不准确。
  2. 忘记 scope 必须是 STATE:该 trigger 只能在州 scope 下使用,若直接写在国家 scope 或省份 scope 的条件块中将静默失败或报错,需要先通过 any_neighbor_state 等方式切换到正确 scope。

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

resistance_target is commonly used in occupation management mods to dynamically trigger events or restrict decision availability based on a state's target resistance value. For example, it can prohibit certain suppression measure options when enemy-occupied regions have excessively high resistance targets. It can also be used in AI condition checks, allowing occupation policy switches only when the target resistance value exceeds a certain threshold.

# Only restrict a certain decision when this state's target resistance exceeds 50
available = {
    resistance_target < 50
}

Synergy

  • [resistance](/wiki/trigger/resistance): resistance_target reflects the target value, while resistance reflects the current actual resistance intensity. Used together, they enable precise resistance trend assessment (high target but low current value indicates resistance is rising).
  • [has_active_resistance](/wiki/trigger/has_active_resistance): First confirm whether active resistance exists in the state, then use resistance_target to judge its intensity, avoiding ineffective checks in states without resistance.
  • [add_resistance_target](/wiki/effect/add_resistance_target): The corresponding effect; commonly used to first check resistance_target as a condition in the same script block, then decide whether to adjust the target value.
  • [occupation_law](/wiki/trigger/occupation_law): Occupation laws are directly related to target resistance. Combined usage enables logic like "trigger specific consequences when occupation law is harsh and target resistance is too high."

Common Pitfalls

  1. Confusing resistance_target with resistance: Beginners often use these interchangeably, but in reality the former is the system-calculated target "equilibrium value" of resistance, while the latter is the current real-time resistance intensity. They can differ significantly, and using the wrong one causes condition timing to be completely inaccurate.
  2. Forgetting that scope must be STATE: This trigger only works under state scope. Writing it directly in country scope or province scope condition blocks will silently fail or throw an error. You must first switch to the correct scope using methods like any_neighbor_state.