Wiki

effect · country_lock_all_division_template

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Lock all the division template at the country level. Note that you need to unlock them in the same way Can also supply the reason it is locked with localization key(You can't use 'set_division_template_lock' individually, because the lock at the country level will not be removed)Ex:country_lock_all_division_template = yescountry_lock_all_division_template = {  is_locked = yes  desc = LOC_KEY}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

常见于剧本事件或决策中,当某国进入特殊历史阶段(如军事管制、战时动员令或外来占领)时,禁止玩家或 AI 修改师团模板,以保证剧本逻辑的完整性。例如,可在国家焦点完成时锁定所有模板,并附上本地化提示文本让玩家了解锁定原因:

focus = {
    id = GER_war_discipline
    # ...
    completion_reward = {
        country_lock_all_division_template = {
            is_locked = yes
            desc = GER_WAR_DISCIPLINE_LOCK_DESC
        }
    }
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):常用于检测某个焦点是否完成,作为触发锁定/解锁的前提条件,确保只在正确的剧本节点执行锁定。
  • [division_template](/wiki/effect/division_template):在锁定之前预先定义好标准化的师团模板,确保锁定时玩家持有的是"官方认可"的编制,而非自行修改的版本。
  • [add_ideas](/wiki/effect/add_ideas):搭配添加一个包含本地化描述的 idea,向玩家直观展示"模板被锁定"状态的游戏内表现,与 desc 的 LOC_KEY 形成视觉联动。
  • [country_event](/wiki/effect/country_event):在锁定后触发一个事件,进一步向玩家解释锁定背景或提供选项,使叙事更为流畅。

常见坑

  1. 只锁不解导致永久锁定:该命令会在国家层级加锁,必须再次调用同一命令并将 is_locked 设为 no 才能解锁;新手容易忘记编写对应的解锁逻辑,导致模板在整局游戏中无法修改,且无法通过 set_division_template_lock 单独绕过。
  2. desc 字段填写错误的字符串而非 LOC_KEYdesc 接受的是本地化键名(即 .yml 文件中定义的 key),若直接填入中文或英文明文字符串而不在本地化文件中定义对应条目,游戏将显示原始键名或报错,而非预期的提示文本。

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

Commonly used in scripted events or decisions to prevent players or AI from modifying division templates when a nation enters a special historical phase (such as martial law, wartime mobilization, or foreign occupation), ensuring narrative integrity. For example, you can lock all templates upon focus completion and attach localized tooltip text to inform players of the reason:

focus = {
    id = GER_war_discipline
    # ...
    completion_reward = {
        country_lock_all_division_template = {
            is_locked = yes
            desc = GER_WAR_DISCIPLINE_LOCK_DESC
        }
    }
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): Commonly used to check whether a focus has been completed, serving as a prerequisite condition for triggering lock/unlock logic and ensuring locks activate only at the correct narrative checkpoint.
  • [division_template](/wiki/effect/division_template): Pre-define standardized division templates before applying the lock to ensure players possess "officially approved" compositions rather than self-modified versions.
  • [add_ideas](/wiki/effect/add_ideas): Pair with adding an idea containing localized description to give players visual in-game feedback that "templates are locked," creating synergy between the desc LOC_KEY and the idea display.
  • [country_event](/wiki/effect/country_event): Trigger an event after locking to further explain the reason for the lock or provide player choices, making the narrative more cohesive.

Common Pitfalls

  1. Locking without unlocking causes permanent lock: This command applies a lock at the country level; you must call the same command again with is_locked set to no to unlock it. Beginners often forget to write corresponding unlock logic, resulting in templates remaining immutable for the entire game and unable to be bypassed via set_division_template_lock alone.
  2. Entering plain text strings instead of LOC_KEYs in the desc field: The desc field accepts localization key names (keys defined in .yml files). If you input plain Chinese or English text without defining corresponding entries in the localization file, the game will display the raw key name or throw an error instead of the intended tooltip text.