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
- 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.
- 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.