Wiki

trigger · is_justifying_wargoal_against

Definition

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

Description

Checks if country is justifying a wargoal against the target. 
Example: ENG = { is_justifying_wargoal_against = GER }

实战 · 配合 · 坑

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

实战用法

常用于在外交或决策场景中检测某国是否正在对特定目标积累战争借口,从而触发警告事件、允许反制决策或调整 AI 外交策略。例如在一个"外交预警"mod 中,当玩家的盟友开始对己方宣战前的准备阶段就发出提示:

# 在一个国家事件的 trigger 块中,检测德国是否正在对法国制造战争借口
trigger = {
    tag = FRA
    is_justifying_wargoal_against = GER  # 检查法国是否在对德宣战准备(反向示例)
}

# 更常见:在 FRA 的决策 available 中检查是否有人针对自己
available = {
    any_enemy_country = {
        is_justifying_wargoal_against = ROOT
    }
}

配合关系

  • [any_enemy_country](/wiki/trigger/any_enemy_country):遍历所有敌对或潜在威胁国家,配合本 trigger 筛选出"正在积累战争借口的国家",常用于防御性反应逻辑。
  • [has_defensive_war_with](/wiki/trigger/has_defensive_war_with):战争借口一旦转化为实际战争后可接续判断,与本 trigger 搭配形成"战前→战中"的状态链检测。
  • [create_wargoal](/wiki/effect/create_wargoal):当检测到对方已在积累借口时,触发己方的反制战争目标创建,形成对等的外交施压逻辑。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier):检测到战争借口积累行为后对第三方施加舆论惩罚,模拟国际社会对侵略准备的谴责反应。

常见坑

  1. scope 方向搞反:这个 trigger 写在哪个国家的 scope 下,检查的就是那个国家是否在对目标积累借口,而非"目标是否对该国积累借口"——新手常常把主动方和被动方颠倒,需要用 any_enemy_country = { is_justifying_wargoal_against = ROOT } 这样的结构才能检测"有人针对自己"。
  2. 战争借口完成后立即失效:战争借口一旦完成(即已可宣战)或直接宣战后,本 trigger 会返回 false,不能用它来检测"持有已完成的战争借口",此时应改用 [has_annex_war_goal](/wiki/trigger/has_annex_war_goal) 等相关条件。

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

Commonly used in diplomatic or decision scenarios to detect whether a nation is accumulating a war justification against a specific target, thereby triggering warning events, enabling counter-decisions, or adjusting AI diplomatic strategy. For example, in a "diplomatic early warning" mod, you can issue a prompt when the player's ally begins preparations for war declaration against you:

# In a country event's trigger block, check whether Germany is justifying a war goal against France
trigger = {
    tag = FRA
    is_justifying_wargoal_against = GER  # Check if France is preparing to declare war on Germany (reverse example)
}

# More common: in FRA's decision available, check if anyone is targeting you
available = {
    any_enemy_country = {
        is_justifying_wargoal_against = ROOT
    }
}

Synergy

  • [any_enemy_country](/wiki/trigger/any_enemy_country): Iterates through all hostile or potentially threatening nations; combined with this trigger to filter out "nations accumulating war justifications." Commonly used for defensive reaction logic.
  • [has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Once a war justification materializes into actual warfare, this can be used in succession to detect status chains from "pre-war → mid-war" scenarios.
  • [create_wargoal](/wiki/effect/create_wargoal): When detecting that the opponent is already accumulating justifications, trigger your own counter war goal creation, forming equivalent diplomatic pressure logic.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): After detecting war justification accumulation behavior, apply opinion penalties to third parties, simulating international condemnation of aggressive preparations.

Common Pitfalls

  1. Reversed scope direction: This trigger, written under which nation's scope, checks whether that nation is accumulating justification against the target, not whether "the target is accumulating justification against that nation." Newcomers often flip the active and passive parties; you must use a structure like any_enemy_country = { is_justifying_wargoal_against = ROOT } to detect "someone targeting yourself."
  2. Trigger fails immediately after justification completion: Once a war justification is completed (i.e., ready to declare war) or war is declared directly, this trigger returns false and cannot be used to detect "holding a completed war justification." In such cases, use [has_annex_war_goal](/wiki/trigger/has_annex_war_goal) or related conditions instead.