Wiki

effect · set_truce

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Sets a truce between scope country and target for days duration. 
Example set_truce = { target = GER days = 90 }

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_truce is commonly used to force both parties into a ceasefire state after diplomatic event resolution, such as preventing the player or AI from immediately declaring war again when a peace negotiation event concludes, or establishing a cooldown period between opposing factions at the end of a civil war script. The following example sets a 90-day truce with France after Germany accepts a ceasefire agreement:

country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        set_truce = {
            target = FRA
            days = 90
        }
    }
}

Synergy

  • [declare_war_on](/wiki/effect/declare_war_on): Commonly paired in logical sequences—after using set_truce to end a conflict cycle, if subsequent scripting requires triggering a new war, you must wait for the truce to expire before combining with this command to plan scripted warfare nodes.
  • [create_wargoal](/wiki/effect/create_wargoal): Accumulate war justifications during the truce period, then combine with this command after the truce expires to give the AI or player legitimate reasons to declare war, forming a complete diplomatic-conflict loop.
  • [has_country_flag](/wiki/trigger/has_country_flag): Track whether a truce has been set via country flags to avoid repeated event triggers that would call set_truce multiple times, maintaining script state idempotency.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): Call within the same option block as set_truce to grant both parties diplomatic attitude bonuses, simulating the relationship improvement brought by the ceasefire.

Common Pitfalls

  1. Scope Confusion: set_truce must be executed within a COUNTRY scope, with target specifying the opposing nation's tag. Beginners often call it directly within STATE scope event blocks, resulting in script errors or silent failures. You must verify the execution context is indeed a country scope.
  2. Bilateral Effect Misconception: This effect establishes a truce simultaneously between both parties, but the script only needs to be called once within one nation's scope. If called separately in both parties' options, it will result in duplicate settings (with the day count determined by the last call or producing anomalies). Avoid redundant execution.