Hands-On Usage
can_declare_war_on is commonly used to verify whether a country meets the conditions to declare war on a target under the current diplomatic status. Typical scenarios include restricting the player or AI to trigger related options only when they can legally declare war within a decision (decision) or national focus (focus) available block, preventing scripts from forcefully circumventing the game's diplomatic rules. For example, in a "Launch a Conquest War" decision:
available = {
can_declare_war_on = GER
}
It can also be combined with dynamic target syntax to check in generic events whether the current nation can declare war on FROM:
trigger = {
can_declare_war_on = FROM
}
Synergy
[declare_war_on](/wiki/effect/declare_war_on): can_declare_war_on serves as a pre-war condition check, typically functioning as an available or limit guard before executing the declare_war_on effect, ensuring the war declaration itself is legal.
[create_wargoal](/wiki/effect/create_wargoal): Before actually declaring war, a war goal usually needs to be created first. Used together, these form a complete workflow: "check declarability → generate war goal → execute war declaration."
[has_defensive_war_with](/wiki/trigger/has_defensive_war_with): When needing to distinguish between "active war declaration" and "already in defensive war" states, using both triggers together allows precise branching logic for different diplomatic scenarios.
[exists](/wiki/trigger/exists): Before checking if war can be declared, first verify that the target nation exists, preventing unexpected trigger behavior caused by the target already being eliminated.
Common Pitfalls
- Mistaking this trigger for only checking "whether a war goal already exists":
can_declare_war_on comprehensively checks game rules, diplomatic relations, war status, and multiple other conditions—it is not merely judging whether a war goal exists. If the target nation and this nation are already in the same war or are allies, this trigger returns false. Beginners often become confused during testing when a war goal clearly exists but the check still fails.
- Using it directly in effect blocks: This trigger can only be placed in conditional judgment blocks (
trigger/limit/available/allowed). Writing it into an effect block causes script errors or silent failure. Novices frequently confuse it with [declare_war_on](/wiki/effect/declare_war_on) and place it in the wrong location.