Wiki

effect · set_faction_name

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

set_faction_name = NEW_LOC_KEY. Sets the faction name to whatever the new key localises to.

实战 · 配合 · 坑

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

实战用法

set_faction_name 常用于动态派系重命名场景,例如当玩家国家完成某个国策后,将原有派系更名为符合新意识形态或剧情的名称。它也常见于借助 create_faction 建立新派系后立即赋予本地化名称,使玩家界面显示更具沉浸感的派系标题。

# 某国家完成国策后,将自己领导的派系更名
complete_national_focus = GER_new_order
hidden_effect = {
    set_faction_name = GER_new_faction_name  # 对应 localisation 中定义的 key
}

配合关系

  • [create_faction](/wiki/effect/create_faction):建立新派系后紧接着调用 set_faction_name,确保派系一经创建就拥有正确的本地化名称,而非显示默认 tag 名。
  • [add_to_faction](/wiki/effect/add_to_faction):邀请新成员加入时可同步触发重命名,配合叙事事件表现派系性质的演变。
  • [dismantle_faction](/wiki/effect/dismantle_faction):先解散旧派系再重建并重命名,常用于彻底重塑阵营体系的剧情分支。
  • [has_capitulated](/wiki/trigger/has_capitulated):作为触发条件判断某大国投降后,在 option 块内用 set_faction_name 标志派系权力更迭。

常见坑

  1. 本地化 key 不存在时不会报错但会显示乱码:新手常直接填写派系的显示文字而非 localisation 文件中定义的 key,导致游戏内显示原始 key 字符串,务必在 localisation/ 目录下为对应语言建好 key-value 对再引用。
  2. 在无派系领袖的 scope 下调用无效:若当前 scope 对应的国家或州并不隶属于任何派系(或该国家不是派系领袖),命令会静默失效,建议配合 [has_capitulated](/wiki/trigger/has_capitulated) 等条件提前校验派系存在性,或确保 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

set_faction_name is commonly used for dynamic faction renaming scenarios, such as when a player nation completes a national focus and renames an existing faction to match a new ideology or narrative. It is also frequently paired with create_faction to assign a localized name immediately upon faction creation, providing players with a more immersive faction title in the interface.

# After a nation completes a national focus, rename the faction it leads
complete_national_focus = GER_new_order
hidden_effect = {
    set_faction_name = GER_new_faction_name  # Corresponds to the key defined in localisation
}

Synergy

  • [create_faction](/wiki/effect/create_faction): Call set_faction_name immediately after establishing a new faction to ensure the faction has the correct localized name upon creation rather than displaying the default tag name.
  • [add_to_faction](/wiki/effect/add_to_faction): Trigger a simultaneous rename when inviting new members to join, working in conjunction with narrative events to reflect the faction's evolving nature.
  • [dismantle_faction](/wiki/effect/dismantle_faction): Dismantle an old faction, then rebuild and rename it—commonly used in story branches that completely reshape the alignment system.
  • [has_capitulated](/wiki/trigger/has_capitulated): Use as a conditional trigger to determine when a major power has capitulated, then call set_faction_name within an option block to mark a shift in faction power.

Common Pitfalls

  1. Localization key does not exist and will display as gibberish without throwing an error: Beginners often enter the faction's display text directly instead of the key defined in the localisation file, resulting in the game displaying the raw key string. Always define key-value pairs in the appropriate language file under localisation/ before referencing them.
  2. Calling the command is ineffective when the scope lacks a faction leader: If the current scope's nation or state does not belong to any faction (or the nation is not the faction leader), the command silently fails. It is recommended to validate faction existence beforehand using conditions like [has_capitulated](/wiki/trigger/has_capitulated), or ensure the scope is switched to the faction leader's nation before execution.