Wiki

trigger · is_licensing_to

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Country is licensing specific equipment to target. License is active
Example: is_licensing_to = {
	target = TAG # licensing to this country
	 #if archetype is specified equipment should not be specified
	archetype = light_tank_chassis #any light tank chassis license
	equipment = { # classical equipment reference
		type = light_tank_equipment_2
		version = 0 # optional: omit to match any version of the type
	}
}

实战 · 配合 · 坑

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

实战用法

is_licensing_to 常用于检测本国是否正在向某个目标国家输出特定装备许可,适合在外交事件、决策或 AI 策略中判断授权关系是否存在。例如,在一个限制玩家随意扩散先进坦克技术的 mod 中,可以将其作为 available 条件,防止玩家在已授权的情况下重复发起许可谈判:

available = {
    NOT = {
        is_licensing_to = {
            target = GER
            archetype = medium_tank_equipment
        }
    }
}

配合关系

  • [create_production_license](/wiki/effect/create_production_license):在确认尚未授权后,用此 effect 正式创建许可协议,两者构成"先检查再创建"的完整流程。
  • [has_any_license](/wiki/trigger/has_any_license):可与之并列使用,前者检查授权方向(我是否授权给对方),后者检查本国是否持有任意许可,组合起来覆盖双向许可状态的判断。
  • [any_subject_country](/wiki/trigger/any_subject_country):常嵌套在该 trigger 外层,用于遍历所有附属国,检查宗主国是否正在向某个藩属输出特定装备授权。
  • [break_embargo](/wiki/effect/break_embargo):当授权关系因外交变化需要终止时,往往需要先通过 is_licensing_to 确认授权存在,再触发相关惩罚或解除逻辑。

常见坑

  1. archetypeequipment 不可同时使用:官方定义已注明,若填写了 archetype 就不应再写 equipment 块,否则脚本解析可能出错或行为不符合预期;选择 archetype 是模糊匹配(匹配该原型下所有变种),选择 equipment 是精确匹配,二者语义互斥。
  2. 方向容易搞反:该 trigger 在授权方(许可出口国)的 scope 下执行,target接收方。新手有时在被授权国的 scope 里使用此 trigger 去判断"我是否获得了某国的许可",这是错误的,应改用 [has_any_license](/wiki/trigger/has_any_license) 或切换 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

is_licensing_to is commonly used to check whether the current nation is exporting a specific equipment license to a target country. It's ideal for diplomatic events, decisions, or AI strategies to verify licensing relationships. For example, in a mod that restricts players from freely proliferating advanced tank technology, you can use it as an available condition to prevent players from repeatedly initiating licensing negotiations when authorization already exists:

available = {
    NOT = {
        is_licensing_to = {
            target = GER
            archetype = medium_tank_equipment
        }
    }
}

Synergy

  • [create_production_license](/wiki/effect/create_production_license): After confirming that no license exists, use this effect to formally establish the licensing agreement. Together, they form a complete "check-then-create" workflow.
  • [has_any_license](/wiki/trigger/has_any_license): Can be used in parallel; the former checks the direction of authorization (am I licensing to the other party), while the latter checks whether the current nation holds any license. Combined, they cover bidirectional licensing state assessment.
  • [any_subject_country](/wiki/trigger/any_subject_country): Often nested outside this trigger to iterate through all subject nations and check whether the overlord is exporting a specific equipment license to a particular vassal.
  • [break_embargo](/wiki/effect/break_embargo): When a licensing relationship needs to be terminated due to diplomatic changes, you typically need to first confirm the authorization exists via is_licensing_to, then trigger relevant penalties or termination logic.

Common Pitfalls

  1. archetype and equipment cannot be used simultaneously: The official specification explicitly states that if you specify archetype, you should not also include an equipment block, otherwise script parsing may fail or behave unexpectedly. Using archetype performs fuzzy matching (matching all variants under that archetype), while equipment performs exact matching—these are mutually exclusive semantically.
  2. Direction is easily reversed: This trigger executes in the scope of the licensing nation (the exporter), and target is the receiving nation. Beginners sometimes mistakenly use this trigger in the scope of the licensed nation to check "did I receive a license from another nation"—this is incorrect. Use [has_any_license](/wiki/trigger/has_any_license) instead, or switch scope to the licensing nation before checking.