Wiki

effect · clr_mio_flag

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:none

Description

Clear the matching flag in the military industrial organization in scope.
ex:
var:my_mio_var = {
  clr_mio_flag = my_flag
}

实战 · 配合 · 坑

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

实战用法

clr_mio_flag 常用于军工组织的动态状态管理场景,例如在某个决策或事件执行后清除之前通过 set_mio_flag 打上的临时标记,从而重置组织的行为开关或触发条件。典型场景包括:军工组织完成某阶段任务后撤销"进行中"标记,或玩家取消某项政策时清除对应的记录旗帜。

# 当某事件触发后,清除军工组织的临时进度旗帜
some_mio_scope = {
    clr_mio_flag = upgrade_phase_in_progress
}

# 通过变量引用目标 MIO 进行清除
var:my_mio_var = {
    clr_mio_flag = special_contract_active
}

配合关系

  • [set_mio_flag](/wiki/effect/set_mio_flag):二者是互补操作,通常先用 set_mio_flag 打标记,在满足特定条件后再用 clr_mio_flag 清除,构成完整的状态生命周期管理。
  • [has_mio_flag](/wiki/trigger/has_mio_flag):在清除旗帜前,先用此触发器检查旗帜是否存在,可以避免在旗帜不存在时执行无意义的清除操作,代码逻辑更严谨。
  • [modify_mio_flag](/wiki/effect/modify_mio_flag):当需要修改旗帜值而非彻底清除时可用 modify_mio_flag,与 clr_mio_flag 形成"修改 vs 清除"的互补关系,根据需求选择其一。

常见坑

  1. Scope 类型错误:新手容易在国家 scope 或省份 scope 下直接书写此命令,导致脚本报错或静默失败。必须确保执行环境是 INDUSTRIAL_ORG scope,通常需要通过 var:xxx 引用或专用的 MIO 迭代块进入正确 scope。
  2. 旗帜名拼写不一致clr_mio_flag 清除的旗帜名与 set_mio_flag 设置时的名称必须完全一致(大小写敏感),若名称不匹配,清除操作不会报错但实际上什么都不会发生,导致旧旗帜残留、触发器持续返回 true。

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

clr_mio_flag is commonly used in dynamic state management scenarios for military industrial organizations. It typically clears temporary markers previously set via set_mio_flag, resetting organizational behavior switches or trigger conditions. Typical use cases include clearing "in-progress" flags after an industrial organization completes a phase of work, or removing corresponding record flags when a player cancels a policy.

# Clear temporary progress flags on an MIO after an event fires
some_mio_scope = {
    clr_mio_flag = upgrade_phase_in_progress
}

# Target an MIO via variable reference and clear its flag
var:my_mio_var = {
    clr_mio_flag = special_contract_active
}

Synergy

  • [set_mio_flag](/wiki/effect/set_mio_flag): These two are complementary operations. Typically set_mio_flag is used to mark first, then clr_mio_flag is used to clear once specific conditions are met, forming a complete state lifecycle management cycle.
  • [has_mio_flag](/wiki/trigger/has_mio_flag): Before clearing a flag, use this trigger to check whether the flag exists first. This prevents executing meaningless clear operations when the flag doesn't exist, resulting in more robust code logic.
  • [modify_mio_flag](/wiki/effect/modify_mio_flag): When you need to modify a flag's value rather than completely remove it, use modify_mio_flag instead. This forms a "modify vs clear" complementary relationship with clr_mio_flag—choose whichever suits your needs.

Common Pitfalls

  1. Incorrect scope type: Beginners often write this command directly within a COUNTRY scope or PROVINCE scope, causing script errors or silent failures. You must ensure the execution environment is an INDUSTRIAL_ORG scope, typically requiring entry through var:xxx references or dedicated MIO iteration blocks.
  2. Flag name spelling inconsistency: The flag name cleared by clr_mio_flag must exactly match the name used when setting it with set_mio_flag (case-sensitive). If the names don't match, the clear operation won't throw an error but effectively does nothing, leaving the old flag in place and causing triggers to continue returning true.