Wiki

effect · set_border_war_data

Definition

  • Supported scope:any
  • Supported target:none

Description

update border war properties

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

set_border_war_data is used to dynamically adjust border war parameters during an ongoing conflict, such as modifying troop limits for both sides, attack directions, or battlefield width. It's ideal for adjusting border conflict rules based on evolving tactical situations within scripted events or decisions. Common scenarios include: adjusting border war intensity through event options after a player makes a diplomatic decision, or balancing battlefield values in timed events based on relative military strength.

# Adjust border war data within an event option
option = {
    name = border_war_event.1.a
    set_border_war_data = {
        attacker_modifier = {
            attack = 0.1
        }
        defender_modifier = {
            defense = -0.1
        }
    }
}

Synergy

  • [has_border_war_between](/wiki/trigger/has_border_war_between): Use this trigger before executing set_border_war_data to verify that a border war actually exists between the two nations, preventing command execution in invalid states that could cause errors or silent failures.
  • [start_border_war](/wiki/effect/start_border_war): Typically initiate a border war with start_border_war first, then use set_border_war_data to fine-tune initial parameters for the newly established conflict.
  • [finalize_border_war](/wiki/effect/finalize_border_war): The companion command for border war resolution. set_border_war_data handles in-process adjustments while finalize_border_war handles settlement and cleanup, together forming a complete border conflict lifecycle management system.
  • [cancel_border_war](/wiki/effect/cancel_border_war): Use in contrast when you need to forcibly terminate and clear a border war, ensuring developers make an explicit choice between "modify" and "cancel".

Common Pitfalls

  1. Calling when no border war exists: If no active border war currently exists between the target nations, executing set_border_war_data will not error but will be completely ineffective. Always perform a condition check using [has_border_war_between](/wiki/trigger/has_border_war_between) first, wrapping the command within an [if](/wiki/effect/if) block.
  2. Incorrect scope targeting: The set_border_war_data attributes require explicitly specifying both combatants. If scope hierarchy is confused (for example, failing to correctly reference the border war's attacker/defender from within a country scope), parameters will not write correctly. When debugging, use [log](/wiki/effect/log) to output the current scope state for investigation.