Wiki

trigger · has_political_power

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

check amount of political power

实战 · 配合 · 坑

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

实战用法

has_political_power 常用于国策、决策或事件的 available / trigger 块,判断当前国家是否积累了足够的政治点数才允许触发某项操作,避免玩家/AI 在政治点数不足时白白触发选项。例如在一个自定义决策中,要求至少储备一定量的政治点数才能解锁:

available = {
    has_political_power > 50
}

也可以在事件选项的 trigger 里用于 AI 权重判断,让 AI 在政治点数充裕时才优先选择该选项。

配合关系

  • [add_political_power](/wiki/effect/add_political_power):最直接的配对——先用 has_political_power 检查余量,再用 add_political_power 消耗或补充,实现"满足阈值才扣费"的决策逻辑。
  • [add_ideas](/wiki/effect/add_ideas):给国家添加顾问/国策思想时,常先检查政治点数是否足够,再执行添加,防止 AI 在点数匮乏时滥用。
  • [command_power](/wiki/trigger/command_power):与 has_political_power 同属"资源储量检查"类 trigger,常并列写在同一 available 块中,同时对政治点和指挥点设门槛。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常与之组合使用——某些决策需要同时完成特定国策 储备足够政治点数才可解锁,两者写在同一条件块中互相约束。

常见坑

  1. 比较运算符漏写或用错has_political_power 后面必须跟比较符(> 50< 100 等),直接写成 has_political_power = 50 在逻辑上是"恰好等于 50",但政治点数几乎不可能精确等于某个整数,导致条件永远不满足,新手常因此误以为 trigger 失效。
  2. 在非 COUNTRY scope 下调用:此 trigger 仅支持国家 scope,若误写在 any_owned_stateany_unit_leader 等子 scope 内部,游戏会报错或静默返回假,需确保调用位置处于国家层级(或通过 OWNER / ROOT 等目标正确引用到国家 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_political_power is commonly used in focus trees, decisions, or events within available / trigger blocks to check whether the current nation has accumulated sufficient political power before allowing a certain action to trigger, preventing players/AI from activating options when political power is insufficient. For example, in a custom decision requiring a minimum reserve of political power to unlock:

available = {
    has_political_power > 50
}

It can also be used within event option trigger blocks for AI weight calculations, allowing the AI to prioritize that option only when political power is abundant.

Synergy

  • [add_political_power](/wiki/effect/add_political_power): The most direct pairing—first use has_political_power to check the remaining amount, then use add_political_power to consume or replenish, implementing a "threshold check before deduction" decision logic.
  • [add_ideas](/wiki/effect/add_ideas): When adding advisors/ideological ideas to a nation, it's common to first check whether political power is sufficient before executing the addition, preventing AI from abusing the feature when points are scarce.
  • [command_power](/wiki/trigger/command_power): Belongs to the same "resource reserve check" trigger category as has_political_power, often written in parallel within the same available block, setting thresholds for both political power and command power simultaneously.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Frequently combined together—certain decisions require completing a specific focus tree and maintaining sufficient political power reserves to unlock, with both conditions written in the same constraint block.

Common Pitfalls

  1. Missing or incorrect comparison operators: has_political_power must be followed by a comparison operator (> 50, < 100, etc.). Writing it as has_political_power = 50 logically means "exactly 50," but political power is almost never precisely equal to a specific integer, causing the condition to never trigger. Beginners often mistakenly assume the trigger is broken because of this.
  2. Calling outside COUNTRY scope: This trigger only supports country scope. If mistakenly written inside sub-scopes like any_owned_state or any_unit_leader, the game will error or silently return false. Ensure the call is at the country level (or correctly reference the country scope through OWNER / ROOT and similar target references).