Wiki

effect · drop_cosmetic_tag

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Drops country cosmetic tag.
Example: INS = { drop_cosmetic_tag }

实战 · 配合 · 坑

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

实战用法

drop_cosmetic_tag 常用于 mod 中需要动态切换国家外观的场景,例如当某个政治事件结束、阵营瓦解或政权更迭后,需要撤销之前赋予的装饰性标签,让国家恢复其原始外观与旗帜。典型场景包括:内战结束后统一方放弃临时标签,或某个事件链完成后去除"占领政府"外观标签。

# 内战结束,执政方恢复原始外观
country_event = {
    id = my_mod.50
    ...
    option = {
        name = my_mod.50.a
        # 先撤销装饰标签,再设置新状态
        drop_cosmetic_tag = yes
        add_stability = 0.05
    }
}

配合关系

  • [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag):在执行 drop_cosmetic_tag 前用此触发器检查当前是否持有某个装饰标签,避免在没有标签时做无意义操作或触发脚本警告。
  • [add_ideas](/wiki/effect/add_ideas):装饰标签往往与特定理念绑定视觉主题,撤销标签后通常需要同步添加或替换对应理念,保持逻辑一致。
  • [country_event](/wiki/effect/country_event):切换装饰标签是事件链中的关键节点,常通过触发后续事件来完成标签切换的叙事过渡。
  • [add_political_power](/wiki/effect/add_political_power):政权更迭(需要 drop 旧装饰标签)往往附带政治点数的奖惩,两者经常出现在同一 option 块中。

常见坑

  1. 作用域混淆drop_cosmetic_tag 只能在 COUNTRY scope 下调用,新手有时在 state scope 或 unit leader scope 的子块中误用,导致脚本报错或静默失效——务必确认外层作用域是具体的国家标签。
  2. 不检查标签是否存在就直接 drop:若该国当前并未持有任何装饰标签就调用此命令,虽然游戏通常不会崩溃,但会产生无意义的日志警告;建议搭配 [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

drop_cosmetic_tag is commonly used in mods for scenarios requiring dynamic switching of a nation's cosmetic appearance. For example, when a political event concludes, a faction dissolves, or a regime changes, you may need to revoke a previously assigned cosmetic tag to restore the nation to its original appearance and flag. Typical use cases include: a unified nation abandoning temporary tags after a civil war ends, or removing an "occupied government" cosmetic tag after completing an event chain.

# Civil war ends, ruling faction reverts to original appearance
country_event = {
    id = my_mod.50
    ...
    option = {
        name = my_mod.50.a
        # Revoke cosmetic tag first, then set new state
        drop_cosmetic_tag = yes
        add_stability = 0.05
    }
}

Synergy

  • [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag): Use this trigger before executing drop_cosmetic_tag to check whether the current nation holds a specific cosmetic tag, avoiding meaningless operations or script warnings when no tag is present.
  • [add_ideas](/wiki/effect/add_ideas): Cosmetic tags are often bound to specific ideas for visual theming. After revoking a tag, you typically need to synchronously add or replace corresponding ideas to maintain logical consistency.
  • [country_event](/wiki/effect/country_event): Switching cosmetic tags is a critical narrative node in event chains, commonly executed by triggering subsequent events to complete the cosmetic transition.
  • [add_political_power](/wiki/effect/add_political_power): Regime changes (requiring old cosmetic tags to be dropped) often come with political power rewards or penalties, frequently appearing together in the same option block.

Common Pitfalls

  1. Scope confusion: drop_cosmetic_tag can only be called within COUNTRY scope. Beginners sometimes misuse it in sub-blocks of state scope or unit leader scope, causing script errors or silent failures. Always verify that the outer scope is a specific nation tag.
  2. Dropping a tag without checking if it exists: If the nation currently holds no cosmetic tags when this command is called, while the game usually won't crash, it will generate meaningless log warnings. It's recommended to pair this with [has_cosmetic_tag](/wiki/trigger/has_cosmetic_tag) for conditional checks to write more robust scripts.