Wiki

effect · set_cosmetic_tag

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Sets country cosmetic tag.
Example: INS = { set_cosmetic_tag = IN1 }

实战 · 配合 · 坑

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

实战用法

set_cosmetic_tag 常用于国家改名、改旗、改国歌等视觉变化场景,例如内战结束后让胜利方切换为特定的 cosmetic tag,或者在走某条国策线后让国家以不同的名称与旗帜示人,而不改变其实际 TAG(不影响条约、外交关系等底层数据)。

# 国策完成后,苏联切换为"苏维埃帝国"的外观标签
focus = {
    id = SOV_soviet_empire
    ...
    completion_reward = {
        set_cosmetic_tag = SOV_EMPIRE
    }
}

配合关系

  • [drop_cosmetic_tag](/wiki/effect/drop_cosmetic_tag) — 与之相对,用于移除当前 cosmetic tag,恢复默认外观;常在特定条件失效或内战重置时配合使用。
  • [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag) — 在触发器中检测当前是否处于某个 cosmetic tag,避免重复设置或用于条件分支判断。
  • [add_ideas](/wiki/effect/add_ideas) — 切换外观标签通常伴随着意识形态或政策的变化,两者搭配可让视觉与实际效果同步呈现。
  • [complete_national_focus](/wiki/effect/complete_national_focus) — 部分 mod 在脚本触发完成国策时,同步调用 set_cosmetic_tag 保证外观与剧情进展一致。

常见坑

  1. cosmetic tag 必须在 common/cosmetic_tags/ 中预先定义,否则游戏会静默忽略或报错——新手常直接写一个不存在的 tag 名,导致外观没有任何变化却不报任何提示。
  2. 重复调用不会"叠加",后一次调用会直接覆盖前一次;如果多条事件链都可能修改同一国家的 cosmetic tag,需要用 [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag) 做好判断,避免意外覆盖掉预期的外观。

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_cosmetic_tag is commonly used for visual changes to a nation such as renaming, flag changes, national anthems, and similar cosmetic modifications. For example, after a civil war ends, the victorious faction can switch to a specific cosmetic tag, or after pursuing a certain focus tree, the nation can appear under a different name and flag without altering its actual TAG (leaving underlying data like treaties and diplomatic relations unaffected).

# After focus completion, the Soviet Union switches to the "Soviet Empire" cosmetic appearance
focus = {
    id = SOV_soviet_empire
    ...
    completion_reward = {
        set_cosmetic_tag = SOV_EMPIRE
    }
}

Synergy

  • [drop_cosmetic_tag](/wiki/effect/drop_cosmetic_tag) — The counterpart effect that removes the current cosmetic tag and restores the default appearance; commonly used in tandem when certain conditions expire or during civil war resets.
  • [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag) — A trigger to check if a nation currently has a specific cosmetic tag, preventing duplicate assignments or enabling conditional branching logic.
  • [add_ideas](/wiki/effect/add_ideas) — Cosmetic tag switches are typically accompanied by ideological or policy shifts; pairing both effects ensures visual and mechanical changes happen in sync.
  • [complete_national_focus](/wiki/effect/complete_national_focus) — Some mods simultaneously call set_cosmetic_tag when scripting focus completion to keep appearance consistent with narrative progression.

Common Pitfalls

  1. The cosmetic tag must be predefined in common/cosmetic_tags/ beforehand, otherwise the game will silently ignore it or throw an error — beginners often write a non-existent tag name directly, resulting in no visual change with no warning message.
  2. Repeated calls do not "stack"; each subsequent call overwrites the previous one. If multiple event chains can modify the same nation's cosmetic tag, use [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag) to prevent accidental overwrites of the intended appearance.