Wiki

trigger · days_since_capitulated

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks the number of days since the country last capitulated, even if it is no longer capitulated.
	If it has not ever capitulated, the value is extremely large.
	It is recommended to combine this with has_capitulated = yes when you specifically want to ignore non-active capitulations.
Examples:
	HOL = { has_capitulated = yes days_since_capitulated > 60 } # The Netherlands has been capitulated for more than two months
	FRA = { has_capitulated = yes days_since_capitulated < 21 } # France has capitulated sometime within the past three weeks
	GER = { OR = { has_capitulated = no days_since_capitulated > 14 } } # Germany is not both actively and recently capitulated

实战 · 配合 · 坑

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

实战用法

days_since_capitulated 常用于 mod 中判断某国战败后的恢复时间窗口,例如让傀儡政权、援助事件或外交选项只在投降后一段时间内有效或失效。也可用于设计"战后重建"机制,在国家投降超过一定天数后才允许触发特定决策或焦点。

# 战后重建决策:法国投降超过30天后可触发援助事件
available = {
    FRA = {
        has_capitulated = yes
        days_since_capitulated > 30
    }
}

配合关系

  • [has_capitulated](/wiki/trigger/has_capitulated):最重要的搭档,用于区分"曾经投降"与"当前仍处于投降状态",避免对已复国的国家误判。
  • [has_defensive_war](/wiki/trigger/has_defensive_war):结合使用可判断敌国是否在投降后仍处于防御战状态,适合复杂战争逻辑。
  • [exists](/wiki/trigger/exists):投降国可能已被吞并,搭配 exists = yes 可防止对不存在国家的条件判断报错。
  • [any_allied_country](/wiki/trigger/any_allied_country):可在盟友 scope 内批量检查阵营内是否有成员近期投降,用于触发盟约保护或援助逻辑。

常见坑

  1. 忘记配合 has_capitulated = yes:若国家已经复国但历史上曾投降,days_since_capitulated 仍会返回一个有效的小数值而非极大值,直接使用会导致条件意外触发,务必先用 has_capitulated = yes 限定当前仍在投降状态。
  2. 在不存在的国家 scope 内调用:若目标国已被吞并(exists = no),进入其 scope 本身可能导致脚本异常,应先用 exists = yes 守卫,再检查投降天数。

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

days_since_capitulated is commonly used in mods to determine recovery time windows after a nation's defeat, such as making puppet regimes, aid events, or diplomatic options only valid or invalid for a certain period after capitulation. It can also be used to design "post-war reconstruction" mechanics, allowing specific decisions or focuses to trigger only after a nation has been capitulated for a certain number of days.

# Post-war reconstruction decision: aid event can trigger for France after capitulation exceeds 30 days
available = {
    FRA = {
        has_capitulated = yes
        days_since_capitulated > 30
    }
}

Synergy

  • [has_capitulated](/wiki/trigger/has_capitulated): The most critical companion trigger, used to distinguish between "has capitulated in the past" and "currently still in capitulated state", avoiding misidentification of already-restored nations.
  • [has_defensive_war](/wiki/trigger/has_defensive_war): When combined, can determine whether an enemy nation is still in defensive war after capitulation, suitable for complex warfare logic.
  • [exists](/wiki/trigger/exists): A capitulated nation may have been annexed, pairing with exists = yes prevents errors when evaluating conditions for non-existent nations.
  • [any_allied_country](/wiki/trigger/any_allied_country): Can batch-check within allied country scope whether faction members have recently capitulated, useful for triggering alliance protection or aid logic.

Common Pitfalls

  1. Forgetting to pair with has_capitulated = yes: If a nation has already been restored but historically capitulated, days_since_capitulated will still return a valid small value rather than an extremely large one. Direct use will cause the condition to trigger unexpectedly. Always first constrain with has_capitulated = yes to ensure the nation is currently in capitulated state.
  2. Calling within scope of a non-existent nation: If the target nation has been annexed (exists = no), entering its scope itself may cause script errors. Always guard with exists = yes first, then check capitulation days.