Wiki

trigger · is_demilitarized_zone

Definition

  • Supported scope:STATE
  • Supported target:any

Description

checks if a state is a demilitarized zone

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

is_demilitarized_zone is commonly used in occupation, diplomacy, or peace treaty mods to detect whether a state is demilitarized, allowing you to decide whether to permit garrison, military construction, or trigger specific events. For example, once a state is demilitarized, you can restrict certain player actions in that state or trigger corresponding AI logic.

# In the available block of a decision, restrict activation to demilitarized zones only
available = {
    ROOT = {
        is_demilitarized_zone = yes
    }
}

Synergy

  • [set_demilitarized_zone](/wiki/effect/set_demilitarized_zone): The most direct complementary effect, used to set or unset a state's demilitarized status, forming a "set-check" loop with this trigger.
  • [has_state_flag](/wiki/trigger/has_state_flag): Demilitarization is often accompanied by custom flags marking special agreements or treaties; using both together enables more precise conditional logic.
  • [is_controlled_by](/wiki/trigger/is_controlled_by): Demilitarized zones typically involve control issues; combined use distinguishes between "enemy-controlled demilitarized zone" and "normal demilitarized zone" scenarios.
  • [building_count_trigger](/wiki/trigger/building_count_trigger): Can be used to verify whether demilitarization constraints are being respected—if military buildings still exist in the state, it triggers breach logic.

Common Pitfalls

  1. Scope Mismatch Errors: This trigger must be called within STATE scope; placing it in a COUNTRY scope condition block (such as directly in a country event's trigger block) will silently fail or error. You must first switch to STATE scope using any_state / capital_scope or similar.
  2. Confusion with Demilitarization Modifiers: Beginners often mistakenly believe that manually adding a "demilitarized" effect via add_state_modifier will make this trigger return yes; in reality, only the built-in flag set through set_demilitarized_zone = yes is correctly recognized by this trigger.