Hands-On Usage
set_mio_icon is commonly used in mods to dynamically change the display icon of military industrial organizations. For example, you can switch to an upgraded icon when an organization completes a specific milestone, or assign different appearances based on scenario events to distinguish faction styles. Note that the icon GFX must be predefined in a .gfx file located in the interface/ directory as sprite types before it can be properly referenced.
# Update MIO icon after completing a certain trait
mio:my_weapons_mio = {
if = {
limit = { is_mio_trait_completed = my_advanced_trait }
set_mio_icon = MY_WEAPONS_MIO_UPGRADED_ICON
}
}
Synergy
[is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): Check if the organization has completed a key trait before deciding whether to switch icons, tying icon changes to research progress.
[set_mio_name_key](/wiki/effect/set_mio_name_key): Simultaneously change both the organization name and icon to maintain consistency between visual and text presentation, commonly seen in "organization upgrade and rename" scripting scenarios.
[complete_mio_trait](/wiki/effect/complete_mio_trait): Update the icon immediately within the same execution block that unlocks a trait, ensuring the in-game display reflects organizational state changes in real time.
[has_mio_flag](/wiki/trigger/has_mio_flag): Use a flag to determine whether an icon has already been changed, preventing duplicate triggering of the same icon-setting logic.
Common Pitfalls
- Referencing undefined GFX names: The parameter passed to
set_mio_icon must be a graphics name already declared with spriteType in a .gfx file. If there's a typo or the file isn't loaded, the game won't report an error but the icon will display as blank or default, misleading newcomers into thinking there's a scripting syntax problem.
- Incorrect scope level: This effect can only execute within
INDUSTRIAL_ORG scope. If written directly in the top-level effect block of a country or event without entering the correct scope via mio:xxx = { }, the command will silently fail without any notification.