Wiki

trigger · compare_autonomy_state

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if autonomy state is higher than other one, example:
compare_autonomy_state > puppet

实战 · 配合 · 坑

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

实战用法

compare_autonomy_state 常用于自治体相关的决策或国策中,判断宗主国与附庸的自治程度是否达到某个阈值,从而解锁特定选项或触发剧本事件。例如在附庸独立运动 mod 中,当附庸的自治等级已高于 puppet 时才允许宗主国进行某项限制决策:

available = {
    compare_autonomy_state > puppet
}

配合关系

  • [has_autonomy_state](/wiki/trigger/has_autonomy_state):先用 has_autonomy_state 精确匹配当前自治状态,再用本 trigger 做范围比较,两者组合可构建"在某区间内"的精细判断。
  • [add_autonomy_score](/wiki/effect/add_autonomy_score):在 effect 块中配合使用,当比较结果为真时触发自治分数的增减,实现自治阶段性推进的逻辑。
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio):与本 trigger 联用,一个判断自治等级的高低,另一个判断当前等级内的进度比例,可写出更精准的条件层。
  • [end_puppet](/wiki/effect/end_puppet):在自治等级已高于特定状态时触发解除附庸,配合本 trigger 作为前置条件,避免过早结束附庸关系。

常见坑

  1. 大小写与等级名称拼写错误:自治等级的标识符(如 puppetdominionautonomous_puppet 等)必须与游戏内定义完全一致,拼写或大小写错误会导致条件永远不触发,且通常没有明显报错提示。
  2. 误用 scope:本 trigger 只在 COUNTRY scope 下有效,若写在 STATE 或 CHARACTER scope 下不会报错但结果始终为假,新手容易将其放入 any_owned_state 等地区循环块内而导致逻辑失效。

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

compare_autonomy_state is commonly used in autonomy-related decisions or national focuses to check whether the autonomy level between a overlord and its subject meets a certain threshold, thereby unlocking specific options or triggering scripted events. For example, in a subject independence mod, the overlord is only allowed to take certain restrictive decisions after the subject's autonomy tier has risen above puppet:

available = {
    compare_autonomy_state > puppet
}

Synergy

  • [has_autonomy_state](/wiki/trigger/has_autonomy_state): Use has_autonomy_state first to match the exact current autonomy state, then use this trigger for range comparison. Together they construct fine-grained "within a range" logic.
  • [add_autonomy_score](/wiki/effect/add_autonomy_score): Use together in effect blocks; when the comparison evaluates to true, trigger increases or decreases to autonomy score, implementing the logic of phased autonomy progression.
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio): Use in conjunction with this trigger—one judges the autonomy tier level, the other judges the progress ratio within the current tier, allowing you to write more precise conditional layers.
  • [end_puppet](/wiki/effect/end_puppet): Trigger the removal of subject status when autonomy tier has risen above a specific state. Use this trigger as a precondition to avoid prematurely ending the subject relationship.

Common Pitfalls

  1. Case sensitivity and autonomy tier name spelling errors: The identifiers for autonomy tiers (such as puppet, dominion, autonomous_puppet, etc.) must match exactly as defined in-game. Spelling or case errors will cause the condition to never fire, and typically produce no obvious error message.
  2. Misusing scope: This trigger is only valid in COUNTRY scope. If placed in STATE or CHARACTER scope it will not error but always evaluate to false. Beginners often mistakenly place it inside regional loops like any_owned_state, causing the logic to fail.