Hands-On Usage
is_mio_trait_available is commonly used in military industrial organization trait unlock logic to dynamically check whether a specific trait currently meets its prerequisites and has not been blocked by mutual exclusions. It works well in the available block of custom MIOs or event trigger conditions, preventing players from bypassing design constraints to forcibly complete traits. For example, you can check in a decision's visible block whether the target MIO has the prerequisites to unlock an advanced trait:
# In the available block of an MIO-related decision
mio:my_custom_mio = {
is_mio_trait_available = {
trait = advanced_production_line
check_mio_mutually_exclusive = yes
check_mio_parent_completed = yes
}
}
Synergy
[is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): First use is_mio_trait_completed to confirm the parent trait is completed, then use this trigger to verify whether the child trait is available. Together they form a complete unlock chain verification.
[complete_mio_trait](/wiki/effect/complete_mio_trait): Before executing complete_mio_trait in an effect block to forcibly complete a trait, typically use this trigger as a precondition check first to prevent bypassing availability checks and causing logic errors.
[has_mio_trait](/wiki/trigger/has_mio_trait): has_mio_trait only checks whether a trait exists in the MIO definition, while this trigger additionally verifies availability. Combined, they can precisely distinguish between "exists but locked" and "exists and available" states.
[is_mio_available](/wiki/trigger/is_mio_available): Before checking specific trait availability, first use is_mio_available to ensure the entire MIO itself is in an active state, avoiding meaningless trait checks on inactive organizations.
Common Pitfalls
- Setting
check_mio_parent_completed to no while expecting parent-child relationships to work: Both optional parameters default to yes. If explicitly set to no, parent completion checks are skipped, causing traits that should be locked to be judged as available, contradicting design intent.
- Calling directly outside
INDUSTRIAL_ORG scope: This trigger only works within MIO scope. If used bare in country scope or other scopes without mio:token = { } wrapping, the game won't error but the condition will never evaluate true, making it difficult to debug.