Hands-On Usage
start_border_war is commonly used in historical event mods to simulate localized border conflicts (such as the Battle of Khalkhin Gol or the Chaco War) without triggering a full-scale war, allowing two nations to settle disputes through small-scale province control. The three callback events on_win/on_lose/on_cancel are the core drivers of the entire conflict resolution system, typically paired with exclusive event chains to implement different outcomes.
# Trigger Sino-Soviet border conflict (called in JAP scope)
start_border_war = {
change_state_after_war = no
combat_width = 60
minimum_duration_in_days = 30
attacker = {
state = 527
num_provinces = 3
on_win = jap_soviet_border.10
on_lose = jap_soviet_border.11
on_cancel = jap_soviet_border.12
modifier = 0.3
dig_in_factor = 0.8
terrain_factor = 0.7
}
defender = {
state = 408
num_provinces = 3
on_win = jap_soviet_border.20
on_lose = jap_soviet_border.21
on_cancel = jap_soviet_border.22
}
}
Synergy
[has_border_war_between](/wiki/trigger/has_border_war_between): Check within event or focus trigger blocks whether a border war already exists between two nations, preventing duplicate triggers of the same conflict that cause script errors.
[cancel_border_war](/wiki/effect/cancel_border_war): Manually terminate an ongoing border war when diplomatic negotiations or specific conditions are met, typically placed in the on_cancel callback event option as a "diplomatic resolution" branch.
[finalize_border_war](/wiki/effect/finalize_border_war): Force the resolution of border war results, paired with timers or specific event triggers to actively determine the outcome after minimum_duration_in_days expires.
[set_border_war_data](/wiki/effect/set_border_war_data): Dynamically adjust combat parameters (such as modifiers) during an ongoing border war, often placed in subsequent events separate from start_border_war to create a "turning point" effect.
Common Pitfalls
- The two states must share a border: If the states specified in
attacker and defender do not share a land boundary, the effect fails silently without error, often causing newcomers to wrongly suspect event trigger conditions and waste time debugging in the wrong direction.
- Confusion over
on_win/on_lose callback scope: The on_win event triggered by the attacker fires in the scope of the attacking nation, while the defender's event fires in the scope of the defending nation. Without using [save_event_target_as](/wiki/effect/save_event_target_as) to preserve a reference to the opponent, it becomes difficult to manipulate the other nation within the event, resulting in incomplete outcome event logic.