Wiki

effect · add_faction_goal

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Adds a goal to the current's country faction.

### Examples

TAG = { add_faction_goal = faction_goal_id }

实战 · 配合 · 坑

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

实战用法

add_faction_goal 常用于派系机制 mod 中,当玩家或 AI 完成特定国策、事件后,为其所在派系动态追加新目标(如扩张领土、推翻某政权等),从而推动派系整体战略进程。例如,某国完成某条国策后自动为派系添加一个战争目标:

focus_complete_effect = {
    add_faction_goal = faction_goal_expand_east
}

配合关系

  • [has_completed_faction_goal](/wiki/trigger/has_completed_faction_goal):用于检测某派系目标是否已完成,常与 add_faction_goal 配合形成"添加目标 → 检测完成 → 触发奖励"的完整流程。
  • [create_faction](/wiki/effect/create_faction):在新建派系后紧接着用 add_faction_goal 为其设定初始目标,确保派系一诞生就有明确行动方向。
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot):派系目标槽位不足时需先扩充槽位,再调用 add_faction_goal 添加目标,两者顺序配合至关重要。
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment):检测目标完成度,可用来决定是否继续追加下一阶段派系目标,与 add_faction_goal 构成阶段性推进逻辑。

常见坑

  1. 忘记检查槽位上限:派系目标槽位有数量限制,若未提前用 add_faction_goal_slot 扩充槽位就直接添加目标,新目标将静默失败而不报错,导致策划逻辑无效执行。
  2. 在非派系成员国 scope 下调用:该 effect 要求执行国必须已属于某个派系,若在独立国(未加入任何派系)的 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

add_faction_goal is commonly used in faction mechanics mods. When a player or AI completes a specific focus or event, it dynamically adds new objectives to their faction (such as territorial expansion, overthrowing a regime, etc.), thereby advancing the faction's overall strategic progress. For example, after a country completes a certain focus, a war goal is automatically added to the faction:

focus_complete_effect = {
    add_faction_goal = faction_goal_expand_east
}

Synergy

  • [has_completed_faction_goal](/wiki/trigger/has_completed_faction_goal): Used to check whether a faction goal has been completed. It is commonly paired with add_faction_goal to form a complete workflow of "add goal → check completion → trigger reward".
  • [create_faction](/wiki/effect/create_faction): Immediately after creating a new faction, use add_faction_goal to set initial objectives for it, ensuring the faction has a clear direction from its inception.
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot): When faction goal slots are insufficient, expand the slots first with add_faction_goal_slot before calling add_faction_goal to add goals. The order of these two operations is critical.
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment): Checks the goal completion rate and can be used to decide whether to continue adding the next phase of faction goals, forming a phased progression logic together with add_faction_goal.

Common Pitfalls

  1. Forgetting to check slot limits: Faction goal slots have a quantity limit. If you directly add goals without first expanding slots using add_faction_goal_slot, the new goal will fail silently without an error message, causing the intended logic to not execute properly.
  2. Calling under a non-faction member country scope: This effect requires the executing country to already belong to a faction. If called under the scope of an independent country (one not in any faction), the effect will not take place. Beginners often overlook the need to check whether a country is in a faction beforehand.