trigger · has_any_license
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Country has any active licenses
Example: has_any_license = yes
has_any_licenseCOUNTRYanyCountry has any active licenses
Example: has_any_license = yes
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.
has_any_license is commonly used in mods related to trade/equipment licensing systems, such as within the available block of a focus or decision to check whether a country is currently enjoying production licenses from another nation, thereby determining whether to unlock additional diplomatic options or trigger diplomatic pressure events. It can also be used in AI strategies to distinguish between two national states—"self-sufficiency" and "license-dependent"—and assign different AI behavior weights accordingly.
# Example: A decision available only to countries with active licenses
decision_category = {
my_embargo_pressure = {
available = {
has_any_license = yes
}
# Trigger diplomatic pressure events against the licensor
}
}
[any_purchase_contract](/wiki/trigger/any_purchase_contract): After has_any_license confirms the existence of a license, use any_purchase_contract to further iterate through specific contract contents and precisely filter for particular equipment or licensors.[break_embargo](/wiki/effect/break_embargo): When detecting an active license and meeting specific conditions, invoke break_embargo to interrupt the corresponding trade relationship; together they form a complete "check-execute" logic loop.[create_production_license](/wiki/effect/create_production_license): Often used as reverse synergy—if has_any_license = no, create a new license via create_production_license to ensure subsequent logic functions properly; using both together enables a "create if absent" template pattern.[all_purchase_contracts](/wiki/trigger/all_purchase_contracts): Pair with has_any_license as a preliminary filter to ensure the list is non-empty when entering all_purchase_contracts iteration, preventing empty sets from causing logical errors.no instead of yes: has_any_license = no means "has absolutely no licenses whatsoever," yet beginners sometimes misinterpret it as "licenses are inactive." In reality, even a single active license will cause it to return false. Pair it with any_purchase_contract for finer-grained detection.any_owned_state or any_unit_leader, the script won't error but the evaluation will silently fail or be ignored by the engine. Always complete the check at the country scope level before entering any sub-scope.