trigger · is_demilitarized_zone
Definition
- Supported scope:
STATE - Supported target:
any
Description
checks if a state is a demilitarized zone
is_demilitarized_zoneSTATEanychecks if a state is a demilitarized zone
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_demilitarized_zone 常用于占领、外交或和平条约类 mod 中,检测某州是否处于非军事化状态,从而决定是否允许驻军、建造军事设施或触发特定事件。例如,当一个州被非军事化后,可以限制该州的某些玩家行为或触发对应的 AI 逻辑。
# 在某个决策的 available 块中,限制仅非军事化州可激活
available = {
ROOT = {
is_demilitarized_zone = yes
}
}
[set_demilitarized_zone](/wiki/effect/set_demilitarized_zone):最直接的配套 effect,用于将一个州设为或取消非军事化状态,与本 trigger 形成"设置-检测"闭环。[has_state_flag](/wiki/trigger/has_state_flag):非军事化往往伴随自定义 flag 标记特殊协议或条约,两者结合可实现更精确的条件判断。[is_controlled_by](/wiki/trigger/is_controlled_by):非军事化区域通常涉及控制权问题,配合使用可区分"被敌方控制的非军事区"与"正常非军事区"两种情形。[building_count_trigger](/wiki/trigger/building_count_trigger):可用于验证非军事化约束是否被遵守——若州内仍存在军事建筑则触发违约逻辑。any_state / capital_scope 等切换到 STATE scope。add_state_modifier 添加了某个"非军事化"效果后本 trigger 就会返回 yes,实际上只有通过 set_demilitarized_zone = yes 设置的内置标志才能被此 trigger 正确识别。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.
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
}
}
[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.any_state / capital_scope or similar.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.