Wiki

trigger · has_autonomy_state

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if country currently has an autonomy state, example:
has_autonomy_state = puppet

实战 · 配合 · 坑

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

实战用法

has_autonomy_state 常用于判断某国当前是否处于特定自治等级,例如在傀儡国的国策或决议中检测自身是否为"puppet"或"dominion",从而解锁争取独立或进一步压制的选项。也可用于宗主国一侧,在 AI 策略或事件中判断附庸国的自治状态再决定是否给予更多自主权。

# 附庸国决议:只有当自身为 puppet 时才可用
available = {
    has_autonomy_state = puppet
}

配合关系

  • [compare_autonomy_state](/wiki/trigger/compare_autonomy_state):与 has_autonomy_state 互补,前者可对两个自治等级进行大小比较,二者常联用以覆盖"等于某等级"与"高于/低于某等级"两种场景。
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio):用于进一步判断当前自治进度比例,配合 has_autonomy_state 可精确描述"处于 puppet 状态且自治进度已超过一半"之类的复合条件。
  • [add_autonomy_score](/wiki/effect/add_autonomy_score):在确认自治等级后,以此 effect 对自治分数进行奖惩,是"先判断后修改"的标准写法。
  • [end_puppet](/wiki/effect/end_puppet):在宗主国事件或国策 effect 块中,先用 has_autonomy_state 确认目标确为附庸,再调用此 effect 解除傀儡关系,避免对非附庸国误触发。

常见坑

  1. 自治状态字符串写错:自治等级的关键字(如 puppetdominionintegrated_puppet 等)必须与游戏内 autonomy_states 中定义的 id 完全一致,拼写或大小写有任何偏差都会导致条件永远不成立,且游戏通常不报错,难以排查。
  2. Scope 混淆:该 trigger 只能用在 COUNTRY scope 下,新手容易在 STATE scope 的 limit 块内直接写,导致脚本报错或被解析器静默忽略;若需在 state 相关循环中使用,必须先用 OWNERcontroller 切换回国家 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

has_autonomy_state is commonly used to check whether a country is currently in a specific autonomy tier. For example, in a puppet state's national focus or decision, you can detect whether it is a "puppet" or "dominion" to unlock options for seeking independence or further suppression. It can also be used on the suzerain side to check a subject's autonomy status in AI strategies or events before deciding whether to grant greater autonomy.

# Subject state decision: only available if the country is a puppet
available = {
    has_autonomy_state = puppet
}

Synergy

  • [compare_autonomy_state](/wiki/trigger/compare_autonomy_state): Complements has_autonomy_state. The former can compare two autonomy tiers, and both are often used together to cover both "equal to a specific tier" and "higher/lower than a tier" scenarios.
  • [compare_autonomy_progress_ratio](/wiki/trigger/compare_autonomy_progress_ratio): Used to further check the current autonomy progress ratio. Combined with has_autonomy_state, it can precisely describe compound conditions like "in puppet state with autonomy progress exceeding fifty percent".
  • [add_autonomy_score](/wiki/effect/add_autonomy_score): After confirming the autonomy tier, use this effect to reward or penalize the autonomy score. This is the standard "check first, then modify" approach.
  • [end_puppet](/wiki/effect/end_puppet): In a suzerain's event or national focus effect block, first confirm the target is indeed a subject using has_autonomy_state, then call this effect to remove the puppet relationship, avoiding accidental triggers on non-subject nations.

Common Pitfalls

  1. Misspelled autonomy state string: The keywords for autonomy tiers (such as puppet, dominion, integrated_puppet, etc.) must exactly match the id defined in the game's autonomy_states, and any spelling or capitalization deviation will cause the condition to never trigger. The game typically does not report such errors, making them difficult to debug.
  2. Scope confusion: This trigger only works in COUNTRY scope. Beginners often mistakenly use it directly in a STATE scope's limit block, causing script errors or silent parsing failures. If you need to use it within state-related loops, you must first switch back to country scope using OWNER or controller.