Hands-On Usage
complete_mio_trait is commonly used in scripted events or focus completion to forcibly unlock a specific trait for a designated military industrial organization without requiring the player to manually progress through the trait tree level by level. This is ideal for mod scenarios involving "story rewards" or "historical milestone-triggered unlocks". For example, when a certain nation completes a specific focus, immediately grant its primary military industrial organization an advanced trait:
# In a focus completion effect block
if = {
limit = { has_mio_flag = mio_upgraded }
var:target_mio = {
complete_mio_trait = {
trait = advanced_manufacturing_trait
show_modifiers = no
}
}
}
Synergy
[is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed) — Check whether the trait is already unlocked before execution to avoid repeated triggers causing logic conflicts.
[has_mio_number_of_completed_traits](/wiki/trigger/has_mio_number_of_completed_traits) — Judge the current number of completed traits to determine whether conditions for triggering additional rewards are met.
[add_mio_size](/wiki/effect/add_mio_size) — Although this command automatically increases size by 1, if additional growth rewards are needed, you can manually stack additional size within the same block.
[set_mio_flag](/wiki/effect/set_mio_flag) — Apply a flag immediately after unlocking the trait to prevent the same event chain from repeatedly executing the same unlock logic.
Common Pitfalls
- Forgetting to switch to INDUSTRIAL_ORG scope: This effect can only be used within a military industrial organization scope. If written directly in a country scope (such as an option block in
country_event) without transitioning to the MIO through variables or a dedicated scope, the script will silently fail without error and the trait will not be unlocked.
- Mistakenly believing that
show_modifiers = no prevents size growth: show_modifiers only controls whether interface tooltips display modifier values; it does not affect the automatic +1 size behavior. If multiple traits are unlocked in quick succession, size will accumulate multiple times, requiring advance planning of the correspondence between trait quantity and size.