Wiki

trigger · num_tech_sharing_groups

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

checks how many groups a nation is a member of

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

num_tech_sharing_groups is commonly used to restrict the availability conditions of certain focuses or decisions, such as "trigger a diplomatic event only if the country has not yet joined any tech sharing group" or "specific thresholds must be met before joining a second sharing group". In the example below, a decision is only allowed to activate when the country belongs to fewer than 1 sharing group:

available = {
    num_tech_sharing_groups < 1
}

You can also use reverse logic to confirm that a country is already in at least one sharing group before unlocking related tech bonus decisions:

trigger = {
    num_tech_sharing_groups > 0
}

Synergy

  • [add_to_tech_sharing_group](/wiki/effect/add_to_tech_sharing_group): The most direct partner; first use num_tech_sharing_groups to check the current membership count, then decide whether to execute the join operation, avoiding duplicate entries into the same type of group.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Commonly combined with this trigger, requiring a country to have completed a specific focus and not yet saturated its tech sharing slots before unlocking advanced diplomatic paths.
  • [any_allied_country](/wiki/trigger/any_allied_country): Used to check if any ally is in the same sharing group, and combined with num_tech_sharing_groups can construct composite conditions related to "tech sharing diplomatic networks".
  • [amount_research_slots](/wiki/trigger/amount_research_slots): Tech sharing is typically evaluated alongside research slots; the two together can design balancing mechanisms like "stronger research capacity, higher sharing group thresholds".

Common Pitfalls

  1. Misusing comparison operator direction: Beginners often write num_tech_sharing_groups < 1 as num_tech_sharing_groups = 0—the latter may be less robust in certain game versions or specific parsing scenarios. It's recommended to consistently use numerical comparison operators (<, >, , etc.) rather than = for quantity checks, to avoid inconsistent boundary behavior.
  2. Overlooking scope restrictions: This trigger is only valid under COUNTRY scope; if mistakenly written in a condition block under STATE or CHARACTER scope, the game will not report an error but will always return false, causing related content to silently fail. This is extremely difficult to debug.