Hands-On Usage
has_license is commonly used to check whether a nation has obtained production licenses for specific equipment from other countries, thereby unlocking exclusive decisions, focus trees, or research bonuses. For example, in WWII-themed mods, you can detect whether a minor nation possesses a German tank production license, and subsequently allow it to construct specific armor divisions or trigger diplomatic events.
# Only permit this decision to execute if the Axis tank license is held
available = {
has_license = {
from = GER
archetype = medium_tank_equipment
}
}
Synergy
[has_any_license](/wiki/trigger/has_any_license): When the source nation or specific model variant is irrelevant and you only need to check "whether any license exists," use this alongside has_license as a coarse/fine filtering pair.
[create_production_license](/wiki/effect/create_production_license): Typically grant licenses using this command in effect blocks, then verify successful granting with has_license in trigger blocks, forming a "grant–verify" closed loop.
[has_design_based_on](/wiki/trigger/has_design_based_on): Combine with has_license to distinguish between "possessing a license" and "already designed a variant based on the license," preventing logical confusion between these two distinct stages.
[any_purchase_contract](/wiki/trigger/any_purchase_contract): Differentiate between "production license" and "procurement contract" as two separate equipment acquisition methods; complex arms trade mods often require checking both simultaneously.
Common Pitfalls
archetype and equipment cannot be used simultaneously: The official specification clearly states they are mutually exclusive; using both results in undefined script behavior. Beginners often mistakenly believe they can stack filters, but in reality you must choose one based on your needs.
- Omitting
from does not mean matching all sources: When the from field is omitted, it matches licenses from any nation. However, if you mistakenly write from with your own TAG, the condition will never be satisfied (a nation cannot issue itself a license), causing the condition to always evaluate false.