Hands-On Usage
add_to_war is commonly used in event-driven diplomatic scenarios, such as when a nation is forced or willingly joins an ongoing war alongside its allies under specific conditions, thereby achieving the narrative effect of "bringing a nation into the conflict." Typical cases include the Soviet Union being forced to declare war on Japan in the historical timeline, smaller nations joining a faction under pressure from major powers, or custom war coalition expansion logic in player mods.
# British event: Soviet Union requests that we join the war against Persia
country_event = {
id = my_mod.42
option = {
name = my_mod.42.a
# Britain joins the Soviet side and declares war on Persia
ENG = {
add_to_war = {
targeted_alliance = SOV
enemy = PER
hostility_reason = asked_to_join
single_target_only = yes
}
}
}
}
Synergy
[has_defensive_war](/wiki/trigger/has_defensive_war) — Validates whether the target party is in a defensive war state before joining, preventing logical contradictions (for example, avoiding situations where you "join the offensive side" while the opponent is shown as the aggressor).
[declare_war_on](/wiki/effect/declare_war_on) — When there is no existing war to join and one side must initiate hostilities first, use this command to start the war, then use add_to_war to bring other nations into the conflict. Together they form a complete war declaration workflow.
[has_defensive_war_with](/wiki/trigger/has_defensive_war_with) — Confirms that the specified war actually exists and the target nation is already engaged in combat. This is a necessary prerequisite check before invoking add_to_war.
[create_wargoal](/wiki/effect/create_wargoal) — After joining a war, supplement your faction with war goals. When paired with add_to_war, this ensures that nations entering the war have clear post-war objectives, rather than simply "fighting without purpose."
Common Pitfalls
-
The nation targeted by targeted_alliance must already be in the war, otherwise the game will silently error or ignore the command entirely. A common beginner mistake is using add_to_war followed by declare_war_on in the same event, causing execution order to become inverted and the targeted_alliance to remain unengaged when the command fires. Always ensure the allied nation is already at war (using [has_defensive_war_with](/wiki/trigger/has_defensive_war_with) or similar triggers as a gating condition) before executing add_to_war.
-
Omitting single_target_only will cause unintended chain declarations of war: If left unset or set to no, the joining nation will automatically declare war on all existing enemies of the targeted_alliance, rather than only the single nation specified in the enemy field. This can easily trigger uncontrollable diplomatic chain reactions in multi-front mods.