Wiki

effect · unlock_national_focus

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

unlocks a focus for a country

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

unlock_national_focus is commonly used in events or decisions to unlock a national focus node prematurely, allowing it to be selected without completing its prerequisite nodes. This is ideal for creating "historical shortcuts" or reward-based mod scenarios (for example, unlocking a focus that normally requires a lengthy prerequisite chain after completing a special task). The following example demonstrates rewarding a player with an unlocked focus in a country event:

country_event = {
    id = my_mod.1
    title = my_mod.1.t
    desc = my_mod.1.d

    option = {
        name = my_mod.1.a
        unlock_national_focus = my_special_focus  # Unlock target focus node
        add_political_power = 50
    }
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus) — Commonly used as a trigger condition to detect when the player has completed a prerequisite focus, then unlock deeper nodes via unlock_national_focus, forming a "conditional unlock" logic chain.
  • [complete_national_focus](/wiki/effect/complete_national_focus) — These have a fundamental difference: if you need to directly complete a focus (and trigger its effects), use the latter; if you only want to make a focus "selectable" without immediately activating it, use unlock_national_focus. Choose based on your design intent.
  • [has_country_flag](/wiki/trigger/has_country_flag) — Combine with country flags as trigger guards to ensure unlocks trigger only once at specific story points, preventing logic confusion from repeated unlocks.
  • [activate_shine_on_focus](/wiki/effect/activate_shine_on_focus) — Use alongside unlocking a focus to highlight the node in the focus tree UI, directing player attention to the newly unlocked focus.

Common Pitfalls

  1. Confusing unlock with completion: unlock_national_focus only removes the prerequisite restriction from a focus, making it selectable—it does not trigger any of that focus's effects. If you need to directly execute a focus's effects, use complete_national_focus instead. Mixing these up will result in effects not triggering as expected.
  2. Focus ID typos without error reporting: The game typically does not produce obvious errors in logs for invalid focus IDs; the focus simply does nothing silently, making it difficult for newcomers to diagnose. Always verify that the ID you provide to unlock_national_focus exactly matches the one defined in focus = { id = ... }, including capitalization.