Wiki

trigger · has_damaged_buildings

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check for damaged buildings of nation

实战 · 配合 · 坑

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

实战用法

has_damaged_buildings 常用于战后重建类事件或决策中,用来检测本国是否存在受损建筑,从而触发相应的援助计划或恢复专注。例如在某 mod 中,当国家遭受轰炸后出现建筑损毁时,自动解锁一个"战后重建"决策:

# 决策的 available 块示例
available = {
    has_damaged_buildings = yes
    has_political_power > 50
}

配合关系

  • [damage_building](/wiki/effect/damage_building):在测试或剧本触发时主动制造建筑损伤,随后用 has_damaged_buildings 检测结果是否生效,形成"施加—验证"的完整逻辑链。
  • [building_count_trigger](/wiki/trigger/building_count_trigger):两者配合可精细区分"建筑是否受损"与"完好建筑数量是否达标",用于分级判断国家基础设施状态。
  • [has_capitulated](/wiki/trigger/has_capitulated):战败投降后往往伴随大量建筑损毁,两者同时检测可精准锁定"刚经历亡国/沦陷"的国家,避免误触发重建逻辑。
  • [controls_state](/wiki/trigger/controls_state):重建决策通常要求国家实际控制受损领土,搭配此 trigger 可排除虽有损毁建筑却已失控省份的情况。

常见坑

  1. scope 混用:该 trigger 只能在 COUNTRY scope 下使用,若误写在 STATE scope(如 every_owned_state 的子块内)会导致脚本报错或静默失效,新手常因此找不到 bug 来源。
  2. yes/no 语义误解has_damaged_buildings = no 并不等同于"所有建筑完好",它只表示当前国家不存在任何受损建筑记录;在建筑刚被摧毁(非损伤)的情况下,结果可能与预期不符,需结合 building_count_trigger 做补充判断。

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_damaged_buildings is commonly used in post-war reconstruction events or decisions to detect whether a nation has damaged buildings, triggering corresponding aid programs or recovery focuses. For example, in certain mods, when a nation suffers bombing and building damage occurs, a "Post-War Reconstruction" decision is automatically unlocked:

# Example of decision available block
available = {
    has_damaged_buildings = yes
    has_political_power > 50
}

Synergy

  • [damage_building](/wiki/effect/damage_building): Actively inflicts building damage during testing or scripted triggers, then uses has_damaged_buildings to verify the result, forming a complete "apply—verify" logical chain.
  • [building_count_trigger](/wiki/trigger/building_count_trigger): Combined use allows fine distinction between "whether buildings are damaged" and "whether intact building count meets threshold", useful for hierarchical assessment of national infrastructure status.
  • [has_capitulated](/wiki/trigger/has_capitulated): Defeat and capitulation typically accompany extensive building destruction; checking both simultaneously allows precise identification of nations that have "just experienced collapse/occupation", preventing accidental triggering of reconstruction logic.
  • [controls_state](/wiki/trigger/controls_state): Reconstruction decisions usually require the nation to actually control damaged territory; pairing with this trigger filters out cases where buildings are damaged but the state has been lost.

Common Pitfalls

  1. Scope confusion: This trigger only works under COUNTRY scope. Mistakenly placing it in STATE scope (such as inside every_owned_state subblocks) causes script errors or silent failure, making it difficult for newcomers to trace the bug source.
  2. Misunderstanding yes/no semantics: has_damaged_buildings = no does not equate to "all buildings intact"—it simply means the current nation has no damaged building records. When buildings are freshly destroyed (not damaged) rather than damaged, results may diverge from expectations; supplementary checks with building_count_trigger are recommended.