Hands-On Usage
has_mio_trait is commonly used to check whether a military industrial organization has already unlocked a specific trait, thereby determining whether subsequent effects should trigger or whether certain tasks become available. For example, within an MIO trait unlock chain, it can be used as a conditional gate to enforce "the prerequisite trait must be completed before the next trait can be unlocked."
# Allow unlocking an advanced trait only if the MIO already possesses a basic trait
mio:my_advanced_mio = {
limit = {
has_mio_trait = basic_manufacturing_trait
}
complete_mio_trait = advanced_manufacturing_trait
}
Synergy
[is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): Often used together to distinguish between "a trait exists in the MIO trait tree" and "a trait has been completed/activated," avoiding logical confusion.
[is_mio_trait_available](/wiki/trigger/is_mio_trait_available): Paired with has_mio_trait in the same available block to both check if a trait exists and confirm it can currently be unlocked, forming a complete prerequisite chain.
[complete_mio_trait](/wiki/effect/complete_mio_trait): A typical "condition → execution" pairing where has_mio_trait first confirms the prerequisite trait, then this effect directly grants the target trait.
[unlock_mio_trait_tooltip](/wiki/effect/unlock_mio_trait_tooltip): Used in tandem when displaying tooltips to inform the player whether the prerequisites for unlocking that trait have been satisfied.
Common Pitfalls
- Incorrect Scope:
has_mio_trait must be used within an INDUSTRIAL_ORG scope. Using it directly in a trigger block at the country or other scope level will fail silently or produce errors. You must first enter the correct scope via mio:my_mio = { ... }.
- Confusion with
is_mio_trait_completed: has_mio_trait only checks whether the trait token belongs to this MIO's trait definition (i.e., whether the trait exists in its trait tree), and does not mean the trait has been activated or completed. If you need to check "already activated," use is_mio_trait_completed instead. The two have different semantics, and mixing them up will cause your conditions to behave unexpectedly.