Wiki

effect · load_focus_tree

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Sets what focus tree a country uses, retains finished shared focuses. Parameters:
 * `keep_completed`: if set to yes (default no), then all completed focuses in the previous focus tree that exists in
 the new focus tree will be kept as completed.
 * `copy_completed_from` if is set to a valid country, then all completed focuses from that country will be marked as completed
 in the new focus tree.
 ### Examples

load_focus_tree = { tree = persian_focus_tree copy_completed_from = PER }

实战 · 配合 · 坑

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

实战用法

load_focus_tree 最常用于国策触发国家转型的场景,例如某国完成特定国策后意识形态发生根本性转变、切换到完全不同的国策树。利用 keep_completedcopy_completed_from 可以让玩家在切换树时保留已有成果,避免进度归零带来的体验割裂。

# 波斯完成改革国策后,切换到新王朝国策树并保留旧树中已完成的共享国策
complete_national_focus = PER_modernization
country_event = { id = persia.10 }
# 在 event 的 option 中:
load_focus_tree = {
    tree = persian_imperial_focus_tree
    keep_completed = yes
}

配合关系

  • [complete_national_focus](/wiki/effect/complete_national_focus):在切换国策树前或切换后立即补全若干关键国策,搭配 copy_completed_from 可以实现更精细的进度迁移控制。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):作为触发条件来判断玩家是否已推进到足够节点,再决定是否执行国策树切换,避免过早加载新树导致逻辑断裂。
  • [add_ideas](/wiki/effect/add_ideas):国策树切换往往伴随国家性质变化,通常需要同步移除旧理念、添加新理念来反映新政权的特性。
  • [country_event](/wiki/effect/country_event):切换国策树前后触发事件,用于向玩家提供叙事说明或提供额外选项,是标准的叙事-机制联动写法。

常见坑

  1. 忘记 tree = 字段直接写树名load_focus_tree 必须使用块语法(花括号)并在内部指定 tree = 树名,若直接写成 load_focus_tree = 树名 则为旧式写法,在某些版本下行为不一致甚至报错,建议统一使用块语法。
  2. copy_completed_from 目标国家不存在时静默失败:若指定的国家标签在触发时已不存在于当局(如已被吞并),游戏不会报错但不会复制任何进度,新手常以为是 keep_completed 的问题而反复排查错误方向,应在使用前用 [exists](/wiki/trigger/exists) 做存在性判断。

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

load_focus_tree is most commonly used in scenarios where national focus completion triggers a fundamental ideological shift or transition to an entirely different focus tree. By leveraging keep_completed or copy_completed_from, you can preserve the player's prior progress when switching trees, avoiding the disjointed experience of losing accumulated work.

# After Persia completes its reform focus, switch to the new dynasty focus tree while preserving completed shared focuses from the old tree
complete_national_focus = PER_modernization
country_event = { id = persia.10 }
# In the event's option block:
load_focus_tree = {
    tree = persian_imperial_focus_tree
    keep_completed = yes
}

Synergy

  • [complete_national_focus](/wiki/effect/complete_national_focus): Complete key focuses before or immediately after switching focus trees; combined with copy_completed_from, this enables fine-grained control over progress migration.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Use as a trigger condition to check whether the player has advanced to a sufficient milestone before deciding whether to load the new tree, preventing logic breaks caused by premature tree loading.
  • [add_ideas](/wiki/effect/add_ideas): Focus tree switches typically involve changes to national character and usually require removing old ideas and adding new ones to reflect the new regime's traits.
  • [country_event](/wiki/effect/country_event): Trigger events before or after switching focus trees to provide narrative explanation or additional choices—a standard practice for narrative-mechanic integration.

Common Pitfalls

  1. Omitting the tree = field and writing the tree name directly: load_focus_tree requires block syntax (curly braces) with tree = tree_name specified inside. Using load_focus_tree = tree_name is legacy syntax and may behave inconsistently or cause errors in certain versions. Always use block syntax for consistency.
  2. Silent failure when the copy_completed_from target nation no longer exists: If the specified country tag has been eliminated from the game world (e.g., annexed) when the effect triggers, the game will not error but will copy no progress. Beginners often mistakenly suspect keep_completed and troubleshoot in the wrong direction; use [exists](/wiki/trigger/exists) to verify existence before applying this effect.