Wiki

trigger · can_research

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if country can research technology

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

can_research is commonly used in tech-restriction mods to determine whether a country qualifies to research a particular technology, thereby deciding whether to display or unlock specific focuses/decisions. A typical scenario is placing tech capability as a prerequisite gate within an available block, preventing the AI or player from circumventing design constraints.

# Available condition for a focus: selectable only when the country can research the technology
focus = {
    id = my_focus_advanced_industry
    available = {
        can_research = industry
    }
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): Often placed together with can_research in the available block. First confirm the relevant prerequisite focus is completed, then verify research capability—a dual-gate approach for stricter validation.
  • [amount_research_slots](/wiki/trigger/amount_research_slots): Used in tandem, these distinguish between "can research" and "has enough slots to research," preventing logic errors when a nation lacks sufficient research slots.
  • [add_tech_bonus](/wiki/effect/add_tech_bonus): After can_research passes in the effect block, grant tech acceleration bonuses, forming a complete logic chain: "can research → grant speed bonus."
  • [add_research_slot](/wiki/effect/add_research_slot): If can_research fails (i.e., cannot research), use this effect in an else branch to supplement research slots or conditions as a fallback measure.

Common Pitfalls

  1. Mistakenly using can_research to check if research is already completed: This trigger only checks "whether research is possible," not "whether research is already done." To determine if a technology is unlocked, use has_tech (exists in-game but outside the whitelist). Newcomers often confuse the two semantics, leading to incorrect condition logic.
  2. Calling outside COUNTRY scope: can_research is only valid under country scope. If written inside subscopes like any_owned_state or any_unit_leader without jumping back to country scope via ROOT/PREV, the script silently fails or errors, making debugging difficult to spot.