Wiki

trigger · focus_progress

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

checks focus progress example:
 focus_progress = { focus = id progress > 0.5 }

实战 · 配合 · 坑

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

实战用法

focus_progress 常用于在国策进行过程中动态解锁或屏蔽某些决议、顾问或事件选项,例如当玩家推进某条关键国策超过一半时才允许触发特定事件或激活决议。在自定义国策树 mod 中也可以用来做"进度检测门控",防止玩家跳过中途直接获取收益。

# 只有当 focus_id 进度超过 50% 时,决议才对玩家可用
available = {
    focus_progress = {
        focus = my_custom_focus
        progress > 0.5
    }
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):二者常配合构成"进行中 vs 已完成"的双重判断,focus_progress 检测进行中的进度,has_completed_focus 检测是否已结束,覆盖完整的生命周期。
  • [has_decision](/wiki/trigger/has_decision):当某个决议需要随国策推进程度分阶段激活时,与 focus_progress 联用可精确控制决议的 available 窗口。
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision):在国策进度达到阈值后的 on_complete 或事件 effect 中调用,将"进度检测"与"决议激活"串联成完整流程。
  • [country_event](/wiki/effect/country_event):配合 focus_progress 作为事件触发 trigger 的条件,实现"国策推进到某阶段自动触发剧情事件"的叙事设计。

常见坑

  1. progress 的范围是 0 到 1 而非 0 到 100:新手常写 progress > 50 导致条件永远为假(国策进度最大值就是 1.0),正确写法是 progress > 0.5
  2. 对已完成国策使用此 trigger 会返回假focus_progress 只对当前正在进行中的国策有效,国策完成后进度数据不再存在,此时应改用 [has_completed_focus](/wiki/trigger/has_completed_focus) 来判断。

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

focus_progress is commonly used to dynamically unlock or block certain decisions, advisors, or event options during a focus's execution. For example, you can allow a specific event to trigger or enable a decision only after the player has progressed a key focus past the halfway mark. In custom focus tree mods, it can also serve as a "progress gate check" to prevent players from bypassing intermediate steps and directly claiming rewards.

# A decision becomes available to the player only when focus_id progress exceeds 50%
available = {
    focus_progress = {
        focus = my_custom_focus
        progress > 0.5
    }
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): These two are often paired to create a dual "in-progress vs completed" check. focus_progress detects progress on an active focus, while has_completed_focus checks if it has finished, covering the complete lifecycle.
  • [has_decision](/wiki/trigger/has_decision): When a decision needs to be staged as a focus progresses, combining it with focus_progress allows precise control over the decision's available window.
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision): Called within on_complete or event effects after the focus reaches a threshold, linking "progress detection" and "decision activation" into a complete workflow.
  • [country_event](/wiki/effect/country_event): Used alongside focus_progress as a condition in event triggers to implement narrative design where "reaching a certain focus stage automatically triggers a story event".

Common Pitfalls

  1. The progress range is 0 to 1, not 0 to 100: Beginners often write progress > 50, causing the condition to always evaluate false (a focus's maximum progress value is 1.0). The correct syntax is progress > 0.5.
  2. Using this trigger on a completed focus returns false: focus_progress only works on focuses that are currently in progress. Once a focus is completed, its progress data no longer exists. Use [has_completed_focus](/wiki/trigger/has_completed_focus) instead to check completion status.