Wiki

trigger · has_military_access_to

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

check country has military access to specified country

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

has_military_access_to is commonly used in diplomatic or decision mods to check whether your nation has obtained military passage rights from another country, thereby determining whether to unlock specific strategic decisions or trigger scripted events. For example, in a mission chain about "transit attack," you can use it as a prerequisite condition to prevent players from executing cross-territory strategic deployment without first obtaining passage rights:

available = {
    has_military_access_to = FROM
}

Synergy

  • [gives_military_access_to](/wiki/trigger/gives_military_access_to): The two are mirror images—has_military_access_to checks "whose territory can I pass through," while gives_military_access_to checks "to whom have I granted passage," using them together provides a complete picture of bidirectional passage status.
  • [has_defensive_war_with](/wiki/trigger/has_defensive_war_with): Determines whether both sides are at war, since passage agreements typically become invalid after warfare begins; combining these prevents logical contradictions.
  • [any_allied_country](/wiki/trigger/any_allied_country): When iterating through allies, nest has_military_access_to to count or confirm which alliance members have already granted passage rights, useful for complex joint operations condition evaluation.
  • [diplomatic_relation](/wiki/effect/diplomatic_relation): When passage conditions are met, use this effect to further adjust diplomatic relations, forming a complete logic chain of "confirm passage → update relations."

Common Pitfalls

  1. Scope direction reversed: Beginners often confuse the scope country and target country—the subject of has_military_access_to is "the country initiating the check," while the brackets contain "the target country being passed through." If reversed, the condition will never trigger as intended.
  2. Mistaking it for inclusion of war status: Military passage agreements and wartime state are two separate systems; being at war with a country does not automatically grant you passage rights through it. When relying on this trigger to judge "whether we can pass through territory to fight," you must additionally combine it with war/alliance-related triggers for complete verification.