Wiki

trigger · has_market_access_with

Definition

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

Description

Check if the country has market access with another country. Example: has_market_access_with = GER

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

has_market_access_with 常用于贸易协定、资源共享或经济外交类 mod 中,判断当前国家与目标国是否建立了市场准入关系,从而决定是否解锁某些决议、国策或奖励。例如,在一个经济合作 mod 中,可以用它来限定某个决议仅在与特定国家有市场准入时才可用:

available = {
    has_market_access_with = GER
    is_in_faction_with = GER
}

配合关系

  • [has_attache](/wiki/trigger/has_attache):驻武官与市场准入通常代表不同层级的双边关系,组合使用可精确筛选"经济+军事"双重合作的国家。
  • [any_allied_country](/wiki/trigger/any_allied_country):在 any 循环中配合使用,可检查是否与任意盟友均建立了市场准入,适合多边贸易判断。
  • [create_import](/wiki/effect/create_import):确认市场准入后触发进口创建,是"先判断准入再建立贸易"的标准流程组合。
  • [has_collaboration](/wiki/trigger/has_collaboration):市场准入和合作度经常在经济渗透或情报类 mod 中同时判断,代表两个国家之间关系深度的不同维度。

常见坑

  1. 目标写成标签变量而非固定标签时忘记 scope 切换:该 trigger 的 target 支持 THISROOT 等代词,但如果直接写国家标签(如 GER),需要确保当前 scope 是 COUNTRY,不能在 STATE scope 下直接调用,否则脚本会静默失败或报错。
  2. 误以为市场准入是对称的has_market_access_with = GER 检查的是当前国家对 GER 的市场准入,并不代表 GER 对当前国家也有准入,双向判断需要在两个 scope 下分别检查。

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_market_access_with is commonly used in trade agreements, resource-sharing, or economic diplomacy mods to check whether the current country has established market access with a target country, thereby determining whether to unlock certain decisions, national focuses, or rewards. For example, in an economic cooperation mod, it can be used to restrict a decision to only be available when market access exists with a specific country:

available = {
    has_market_access_with = GER
    is_in_faction_with = GER
}

Synergy

  • [has_attache](/wiki/trigger/has_attache): Military attaches and market access typically represent different levels of bilateral relations. Using them together allows precise filtering of countries with "economic + military" dual cooperation.
  • [any_allied_country](/wiki/trigger/any_allied_country): When used in conjunction within an any loop, it can check whether market access has been established with any allied countries, suitable for multilateral trade assessments.
  • [create_import](/wiki/effect/create_import): After confirming market access, trigger import creation. This is the standard combined workflow of "check access first, then establish trade."
  • [has_collaboration](/wiki/trigger/has_collaboration): Market access and collaboration level are often judged simultaneously in economic infiltration or intelligence mods, representing different dimensions of relationship depth between two countries.

Common Pitfalls

  1. Forgetting scope switching when the target is a variable rather than a fixed tag: This trigger's target supports pronouns like THIS and ROOT, but if you write a country tag directly (such as GER), you must ensure the current scope is COUNTRY. It cannot be called directly under STATE scope, otherwise the script will fail silently or throw an error.
  2. Mistakenly assuming market access is symmetrical: has_market_access_with = GER checks whether the current country has market access to GER; it does not mean GER also has access to the current country. Bidirectional checks require separate verification under two different scopes.