Wiki

trigger · has_completed_faction_goal

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks if the country's faction has successfully completed a goal

### Examples

TAG = { has_completed_faction_goal = goal_id }

实战 · 配合 · 坑

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

实战用法

has_completed_faction_goal 常用于派系合作 mod 中,当某派系完成了特定阶段性目标后,解锁后续决议、触发奖励事件或开放新的国策树分支。例如,在一个多国联合派系 mod 里,检测同盟完成了某战略目标后才允许领头国发动下一阶段战争目标:

available = {
    has_completed_faction_goal = faction_goal_phase_one
}

配合关系

  • [add_faction_goal](/wiki/effect/add_faction_goal):通常先用此 effect 为派系添加目标,之后再用 has_completed_faction_goal 检测该目标是否达成,形成"布置目标 → 检测完成"的完整流程。
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment):两者搭配可区分"部分完成度"与"完全完成"的逻辑,前者做进度百分比判断,后者做最终完成状态判断。
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot):在确认旧目标已完成后,配合此 effect 开放新的目标槽位,实现派系目标的阶段式推进。
  • [country_event](/wiki/effect/country_event):将 trigger 放在事件触发条件中,派系目标达成后自动推送剧情事件,给玩家明确的反馈与叙事节点。

常见坑

  1. goal_id 填写错误:新手常把 add_faction_goal 中定义的目标 ID 写错或大小写不一致,导致 trigger 永远返回假而找不到原因,务必确保两处 ID 完全一致。
  2. Scope 混用:此 trigger 仅在 COUNTRY scope 下有效,若误写在 STATE 或 CHARACTER scope 内,游戏不会报错但条件始终不成立,排查时需重点检查外层 scope 是否正确指向了国家。

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

has_completed_faction_goal is commonly used in faction cooperation mods. When a faction completes a specific milestone objective, it unlocks subsequent decisions, triggers reward events, or opens new national focus tree branches. For example, in a multi-nation alliance mod, you can check whether the alliance has completed a strategic objective before allowing the leading nation to initiate the next phase of war goals:

available = {
    has_completed_faction_goal = faction_goal_phase_one
}

Synergy

  • [add_faction_goal](/wiki/effect/add_faction_goal): Typically use this effect first to add objectives to a faction, then use has_completed_faction_goal to check whether that objective is achieved, forming a complete "assign objective → verify completion" workflow.
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment): Both can work together to distinguish between "partial completion" and "full completion" logic. The former handles progress percentage checks, while the latter handles final completion status.
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot): After confirming that old objectives are complete, combine this effect with opening new objective slots to achieve phased progression of faction goals.
  • [country_event](/wiki/effect/country_event): Place the trigger in event firing conditions so that narrative events are automatically pushed to the player when faction objectives are achieved, providing clear feedback and story beats.

Common Pitfalls

  1. Incorrect goal_id: Beginners often misspell the goal ID defined in add_faction_goal or use inconsistent casing, causing the trigger to always return false with no clear reason. Always ensure that the IDs in both places match exactly.
  2. Scope confusion: This trigger only works within COUNTRY scope. If mistakenly placed within STATE or CHARACTER scope, the game will not error but the condition will never be true. When debugging, pay special attention to verifying that the outer scope correctly points to a country.