Wiki

effect · give_military_access

Definition

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

Description

gives military access to the 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

give_military_access is commonly used in diplomatic events, national focus completions, or alliance agreements to automatically grant the target nation military access to your territory, bypassing manual diplomatic negotiation steps. For example, in a "Sign Military Agreement" event, you can immediately grant the other side access rights:

country_event = {
    id = my_mod.10
    option = {
        name = my_mod.10.a
        # Current scope is GER, granting ITA military access to GER
        give_military_access = ITA
    }
}

Synergy

  • [gives_military_access_to](/wiki/trigger/gives_military_access_to): Check within a trigger block whether a nation has already been granted military access. This forms a "check-execute" loop with give_military_access, preventing duplicate grants.
  • [diplomatic_relation](/wiki/effect/diplomatic_relation): Military access typically accompanies deeper diplomatic shifts (such as establishing non-aggression pacts). Combining these two effects simulates complete bilateral agreements.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): Add opinion modifiers after granting access to reflect the target nation's attitude toward this diplomatic action, making event logic more comprehensive.
  • [country_event](/wiki/effect/country_event): Trigger a confirmation or notification event in the target nation after granting access, ensuring the player or AI is aware that permissions are active and improving narrative continuity.

Common Pitfalls

  1. Scope direction confusion: give_military_access = ITA means "the current scope nation (e.g., GER) grants military access to ITA," meaning ITA can traverse through GER, not the other way around. Beginners often swap the granting party and the beneficiary, causing military access to be granted in the wrong direction.
  2. Forgetting to capitalize country tags or using incorrect scope keywords: The target supports direct country tags (e.g., ITA) or scope keywords (e.g., FROM), but misspelling lowercase tags or making typos won't produce an error—the effect silently fails. Carefully check your logs for verification.