trigger · has_war_together_with
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
Are the countries fighting on the same side of a war
has_war_together_withCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALAre the countries fighting on the same side of a war
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_war_together_with 常用于盟友合作相关的国家事件或决策中,例如只有当两国并肩作战时才允许触发联合军事援助决策,或在外交 AI 策略里判断当前是否与目标国处于同一战线。典型场景:某派系成员想对共同敌人发动追加战役,先确认双方确实同在一场战争的同侧再执行后续 effect。
# 仅当本国与 GER 在同一场战争中并肩作战时,才允许触发联合进攻决策
available = {
has_war_together_with = GER
}
[has_defensive_war](/wiki/trigger/has_defensive_war) — 先判断本国是否处于防御战,再结合 has_war_together_with 确认某盟友也在同侧,用于区分"共同防御"与"共同进攻"两种援助逻辑。[any_allied_country](/wiki/trigger/any_allied_country) — 遍历所有盟友并嵌套 has_war_together_with,可精确筛选出既是盟友、又在同一战争同侧的国家,避免把尚未参战的盟友误算在内。[add_to_war](/wiki/effect/add_to_war) — 当确认目标国已与本国并肩作战后,再用此 effect 拉入其他国家参战,逻辑上形成"验证现有战争关系 → 扩大参战方"的完整链条。[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — 在并肩作战条件成立时给予双边好感度奖励,模拟战时同盟情谊加深的叙事效果。has_war_together_with 返回真,只有双方在同一场战争且站在同一阵营才会触发;若目标国尚未 add_to_war,此 trigger 会静默返回假而不报错,极易导致条件永远不满足。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.
has_war_together_with is commonly used in country events or decisions related to ally cooperation, such as enabling joint military aid decisions only when two nations are fighting side by side, or determining in diplomatic AI strategies whether the current target nation is on the same front. Typical scenario: a faction member wants to launch an additional campaign against a common enemy, first confirming both sides are truly on the same side of a war before executing subsequent effects.
# Only allow joint offensive decision to trigger when this country is fighting alongside GER in the same war
available = {
has_war_together_with = GER
}
[has_defensive_war](/wiki/trigger/has_defensive_war) — First check if this country is in a defensive war, then combine with has_war_together_with to confirm an ally is also on the same side, useful for distinguishing between "joint defense" and "joint offense" aid logic.[any_allied_country](/wiki/trigger/any_allied_country) — Iterate through all allies and nest has_war_together_with to precisely filter countries that are both allies and on the same side of a war, avoiding mistakenly counting allies that haven't entered combat.[add_to_war](/wiki/effect/add_to_war) — After confirming the target country is already fighting alongside this nation, use this effect to bring other countries into the war, forming a complete logic chain of "verify existing war relationship → expand participants."[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — Grant bilateral opinion bonuses when fighting side by side conditions are met, simulating the narrative effect of deepened alliance bonds during wartime.has_war_together_with returns true; it only triggers when both are in the same war and on the same side. If the target nation hasn't been added via add_to_war, this trigger silently returns false without error, easily causing conditions to never be satisfied.