Wiki

effect · set_mio_name_key

Definition

  • Supported scope:INDUSTRIAL_ORG
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Set the localisation key used to generate the name of the military industrial organization in scope.
The localisation key may be a scripted localisation (triggers evaluated in MIO scope).
ex:
mio:my_mio = {
  set_mio_name_key = MY_NEW_MIO_NAME_KEY
}

实战 · 配合 · 坑

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

实战用法

set_mio_name_key 用于在运行时动态替换军事工业组织的显示名称,常见于剧情事件驱动的 MIO 改组场景(例如国有化、改名换牌、战时兼并),或者根据玩家选择分支赋予同一 MIO 不同的阵营名称。本地化键可指向脚本化本地化(scripted localisation),令名称能根据触发时的 MIO 范围内条件动态生成。

# 某个事件的 option 中,将 MIO 切换为新名称
option = {
    name = my_event.1.a
    mio:axis_arms_consortium = {
        set_mio_name_key = REARMED_AXIS_ARMS_NAME
        set_mio_icon = GFX_rearmed_axis_arms_icon
    }
}

配合关系

  • [set_mio_icon](/wiki/effect/set_mio_icon):更名时通常同步替换图标,保持 MIO 的视觉身份与新名称一致。
  • [complete_mio_trait](/wiki/effect/complete_mio_trait):改组事件中往往同时解锁新特性,与改名一起标志组织进入新阶段。
  • [is_military_industrial_organization](/wiki/trigger/is_military_industrial_organization):在执行改名前用作守卫条件,确认当前 scope 确实是 MIO 而非其他组织类型,避免意外报错。
  • [set_mio_flag](/wiki/effect/set_mio_flag):配合旗标记录"已改名"状态,防止同一 MIO 在后续事件中被重复触发改名逻辑。

常见坑

  1. 本地化键拼写错误或缺失:键名填写后若对应的 .yml 本地化文件中不存在该条目,游戏会直接显示键名字符串而非预期名称,且不会报错,极难排查——务必在提交前验证本地化文件已包含该键。
  2. 在非 INDUSTRIAL_ORG scope 下调用:直接在国家 scope 或事件根 scope 中写 set_mio_name_key 而忘记通过 mio:xxx = { ... } 切换到正确 scope,会导致命令静默失效,新手常误以为是本地化问题而走弯路。

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_mio_name_key dynamically replaces the display name of a military industrial organization at runtime, commonly used in narrative-driven MIO reorganization scenarios such as nationalization, rebranding, wartime consolidation, or assigning different faction names to the same MIO based on player choices. The localization key can point to scripted localization, allowing the name to be dynamically generated based on conditions within the MIO's scope at the time of execution.

# Within an event option, switch the MIO to a new name
option = {
    name = my_event.1.a
    mio:axis_arms_consortium = {
        set_mio_name_key = REARMED_AXIS_ARMS_NAME
        set_mio_icon = GFX_rearmed_axis_arms_icon
    }
}

Synergy

  • [set_mio_icon](/wiki/effect/set_mio_icon): Icon replacement typically accompanies renaming to maintain visual identity consistency between the MIO's appearance and its new name.
  • [complete_mio_trait](/wiki/effect/complete_mio_trait): Reorganization events often unlock new traits simultaneously, signifying the organization's transition into a new phase alongside renaming.
  • [is_military_industrial_organization](/wiki/trigger/is_military_industrial_organization): Serves as a guard condition before executing the rename, confirming the current scope is genuinely an MIO rather than another organization type, preventing unexpected errors.
  • [set_mio_flag](/wiki/effect/set_mio_flag): Paired with flags to track "already renamed" state, preventing the same MIO from being repeatedly triggered by rename logic in subsequent events.

Common Pitfalls

  1. Localization key typos or missing entries: If the key name doesn't exist in the corresponding .yml localization file after being entered, the game displays the raw key string instead of the intended name and produces no error—making it extremely difficult to diagnose. Always verify that the localization file contains the key before submission.
  2. Invoking outside INDUSTRIAL_ORG scope: Writing set_mio_name_key directly in national scope or event root scope while forgetting to switch to the correct scope via mio:xxx = { ... } causes the command to silently fail. Novices often mistake this for a localization issue and waste time troubleshooting.