Wiki

effect · remove_faction_goal

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Remove a goal from the current's country faction.

### Examples

TAG = { remove_faction_goal = faction_goal_id }

实战 · 配合 · 坑

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

实战用法

remove_faction_goal 常用于派系机制 mod 中,当某个派系目标已完成、过期或玩家/AI 通过特定决议放弃某项目标时,将其从当前国家的派系目标列表中移除,以保持派系目标池整洁有效。例如一个派系合作事件中,选择某选项后撤销之前添加的扩张目标:

# 当本国退出进攻计划时,移除对应的派系目标
GER = {
    remove_faction_goal = faction_goal_expand_east
}

配合关系

  • [add_faction_goal](/wiki/effect/add_faction_goal):通常成对出现,先用 add_faction_goal 添加目标,后续条件不满足时用 remove_faction_goal 撤销,构成完整的目标生命周期管理。
  • [has_completed_faction_goal](/wiki/trigger/has_completed_faction_goal):在移除前可用此触发器检查目标是否已完成,避免移除一个尚未履行的有效目标,导致逻辑混乱。
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment):用于评估当前目标完成度,配合数值阈值判断是否应当放弃某个低完成度的目标并调用移除命令。
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot):移除旧目标后,常紧跟扩充目标槽位或补充新目标,保持派系目标数量符合设计预期。

常见坑

  1. 目标 ID 拼写错误或未注册faction_goal_id 必须与 add_faction_goal 中定义并已添加的目标字符串完全一致,若写错 ID 脚本不会报错但也不会有任何效果,目标依然存在,极难排查。
  2. 在非派系领袖国执行:该 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

remove_faction_goal is commonly used in faction mechanics mods to remove faction goals from a country's active goal list when objectives are completed, expired, or abandoned by the player/AI through specific decisions, keeping the faction goal pool clean and functional. For example, in a faction cooperation event, selecting an option revokes a previously added expansion objective:

# Remove the corresponding faction goal when this nation withdraws from the offensive plan
GER = {
    remove_faction_goal = faction_goal_expand_east
}

Synergy

  • [add_faction_goal](/wiki/effect/add_faction_goal): Typically appears in pairs—use add_faction_goal to add a goal first, then call remove_faction_goal when conditions are no longer met, forming a complete goal lifecycle management system.
  • [has_completed_faction_goal](/wiki/trigger/has_completed_faction_goal): Before removal, use this trigger to verify whether the goal is already completed, preventing accidental removal of still-valid unfinished goals that would cause logic conflicts.
  • [faction_goal_fulfillment](/wiki/trigger/faction_goal_fulfillment): Assess the current goal completion percentage and decide whether to abandon a low-completion goal by comparing against numerical thresholds before invoking the removal command.
  • [add_faction_goal_slot](/wiki/effect/add_faction_goal_slot): After removing old goals, frequently follow up by expanding goal slots or adding new goals to maintain faction goal counts within design specifications.

Common Pitfalls

  1. Typos in goal ID or unregistered goals: The faction_goal_id must match exactly the goal string defined and added in add_faction_goal. Misspelling the ID causes silent failure—the script won't error but produces no effect and the goal persists, making it extremely difficult to debug.
  2. Executing on non-faction-leader nations: This effect operates at the scoped nation level. If that nation is not the faction leader or doesn't currently hold the specified goal, execution silently fails. Verify goal ownership with relevant triggers before executing removal rather than blindly calling it on all member nations.