Wiki

effect · set_demilitarized_zone

Definition

  • Supported scope:STATE
  • Supported target:none

Description

sets the demilitarized status for currently scoped state

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

set_demilitarized_zone 常用于和平条约 mod、战后结算事件或条件触发的外交系统中,将特定州设为非军事区以模拟真实历史协议(如莱茵兰非军事化)。也可在 scripted_effect 里批量处理多个州,实现"大国强制解除武装"类玩法。

# 在和平事件 option 中,将某州设为非军事区
option = {
    name = peace_event.1.a
    # scope 已为目标 STATE
    set_demilitarized_zone = yes
    set_occupation_law = dmz_administration
}

配合关系

  • [is_demilitarized_zone](/wiki/trigger/is_demilitarized_zone) — 在执行前先检查该州当前是否已是非军事区状态,避免重复触发或逻辑冲突。
  • [remove_building](/wiki/effect/remove_building) / [damage_building](/wiki/effect/damage_building) — 非军事区通常伴随拆除或破坏军事建筑,两者组合可还原历史上的裁军条款。
  • [add_state_modifier](/wiki/effect/add_state_modifier) — 同步叠加一个自定义 modifier,为非军事区添加额外的游戏机制惩罚或加成(如减少驻军消耗)。
  • [set_state_flag](/wiki/effect/set_state_flag) — 打上标记旗,供后续事件或 decision 通过 [has_state_flag](/wiki/trigger/has_state_flag) 检测该州是否曾被非军事化,实现多步剧情链。

常见坑

  1. scope 写错:该 effect 必须在 STATE scope 下调用,若误写在 COUNTRY scope 里(如直接放在国家事件 immediate 块而不先切换 scope)会静默失效,且日志不一定报错,导致效果不生效难以排查。
  2. 只设标记、忘记配套逻辑set_demilitarized_zone 本身只改变非军事区标志位,并不自动阻止建造或移除已有部队——玩家仍可在该州建造和驻军,需配合 decision/trigger 主动限制,否则"非军事区"在游戏里形同虚设。

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_demilitarized_zone is commonly used in peace treaty mods, post-war settlement events, or conditionally triggered diplomatic systems to designate specific states as demilitarized zones, simulating real historical agreements (such as the Rhineland demilitarization). It can also be batch-processed within scripted_effect to handle multiple states, enabling "great power forced disarmament" gameplay mechanics.

# In a peace event option, set a state as a demilitarized zone
option = {
    name = peace_event.1.a
    # scope is already the target STATE
    set_demilitarized_zone = yes
    set_occupation_law = dmz_administration
}

Synergy

  • [is_demilitarized_zone](/wiki/trigger/is_demilitarized_zone) — Check whether the state is currently already a demilitarized zone before execution to avoid duplicate triggers or logical conflicts.
  • [remove_building](/wiki/effect/remove_building) / [damage_building](/wiki/effect/damage_building) — Demilitarized zones typically accompany the removal or destruction of military buildings; combining these effects can recreate historical disarmament clauses.
  • [add_state_modifier](/wiki/effect/add_state_modifier) — Stack a custom modifier simultaneously to add additional game mechanics penalties or bonuses to the demilitarized zone (such as reduced garrison costs).
  • [set_state_flag](/wiki/effect/set_state_flag) — Set a flag marker for subsequent events or decisions to detect via [has_state_flag](/wiki/trigger/has_state_flag) whether the state has been demilitarized, enabling multi-step story chains.

Common Pitfalls

  1. Incorrect scope: This effect must be called under STATE scope. If mistakenly written in COUNTRY scope (such as directly placed in a national event's immediate block without first switching scope), it will silently fail without necessarily producing log errors, making the effect non-functional and difficult to debug.
  2. Setting the flag but forgetting supporting logic: set_demilitarized_zone itself only changes the demilitarized zone flag; it does not automatically prevent construction or remove existing armies — players can still build and garrison troops in that state. This requires active restriction through decision/trigger logic; otherwise, the "demilitarized zone" becomes meaningless in gameplay.