Hands-On Usage
gives_military_access_to is commonly used in diplomatic or strategic decision scenarios, such as checking whether the player/AI has already obtained transit permission from a certain nation before allowing subsequent decisions to attack via that route, or validating diplomatic relationship states in achievement/event trigger conditions. Typical usage occurs in event trigger blocks or decision available blocks, where you check whether the current country is currently granting military passage rights to a specific nation.
# Example: This decision is only available if this nation is granting military access to Germany
decision_example = {
available = {
gives_military_access_to = GER
}
...
}
Synergy
[has_country_flag](/wiki/trigger/has_country_flag): Typically check whether a diplomatic process flag has been set before evaluating military passage rights; combining these two allows precise control over event chain trigger timing.
[any_allied_country](/wiki/trigger/any_allied_country): When iterating through allies in a nested fashion, you can check "whether any ally is granting passage rights to the specified nation," ideal for constructing alliance diplomacy chain logic.
[has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Combined with this trigger, you can detect edge-case diplomatic contradictions like "is this nation granting passage rights while simultaneously in a defensive war with that same nation," useful for special events or warning triggers.
[diplomatic_relation](/wiki/effect/diplomatic_relation): As the corresponding effect, when gives_military_access_to evaluates to false, you can use this command to supplement and establish or modify diplomatic relations, forming a complete "check → compensate" logic flow.
Common Pitfalls
- Scope direction confusion: This trigger checks whether the current scope nation is granting passage rights to the target nation, not the reverse (target nation granting to current nation). Beginners often mix up provider and receiver; if you need to check "whether my nation has obtained passage rights from a certain nation," you must switch to that other nation's scope to use this trigger.
- Misuse when hardcoding nation TAGs instead of scope keywords as the target: The target supports scope keywords like
THIS/ROOT, but beginners sometimes hardcode their own TAG directly (e.g., writing gives_military_access_to = GER within Germany's scope), resulting in a meaningless check like "is Germany granting passage rights to itself." Always prioritize dynamic pointers like THIS or ROOT to ensure logic portability.