Wiki

effect · every_country_with_original_tag

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on a all countries with original tag (or \"random_select_amount\" of random country if specified) that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
By default the effects are only displayed once, you may display them for each matching country with display_individual_scopes.
ex:
every_country_with_original_tag = {
	original_tag_to_check = ENG # the effect will only run on countries that has this original tag
	tooltip = my_loc_key # Optional
	random_select_amount = 3 # Optional
	display_individual_scopes = yes # Optional - default = no
	... country scope effects ...
}

实战 · 配合 · 坑

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

实战用法

every_country_with_original_tag 适合在分裂国家或傀儡国场景中,对所有曾拥有某原始 TAG 的国家(如通过内战或自治领释放产生的多个同源国)批量执行效果,例如同时向所有德国继承者添加某个国家理念或改变政治关系。也可在事件中配合 random_select_amount 随机挑选其中若干个进行操作,避免全量触发带来的平衡问题。

# 对所有原始 TAG 为 GER 的国家添加战争支持并设置国家旗帜
every_country_with_original_tag = {
    original_tag_to_check = GER
    limit = {
        exists = yes
        has_war = yes
    }
    add_war_support = 0.10
    set_country_flag = received_ger_war_bonus
}

配合关系

  • original_tag:在 limit 块内可进一步用于筛选,确认当前迭代国家的原始 TAG 符合预期,避免多重继承场景下误触发。
  • exists:在 limit 中用于排除已亡国(不存在于游戏中)的同源国,防止对不存在的 scope 执行效果引发错误。
  • add_ideas:最常见的批量操作目标,向所有符合条件的同源国统一添加国家理念,实现政策联动。
  • set_country_flag:配合使用可为每个匹配国家分别打上标记,供后续事件或 trigger 逐一检测,实现链式逻辑。

常见坑

  1. 遗漏 original_tag_to_check 字段:该字段是必填核心参数,若省略则 effect 无法正确筛选目标国家,通常会导致脚本静默失效或报错,新手容易将其误认为可选的 limit 条件而放入 limit 块中写成 original_tag = XXX——但 limit 内的 original_tag trigger 与外部 original_tag_to_check 参数作用层不同,不可替代。
  2. 对已亡国 scope 执行效果:如果不在 limit 中加 exists = yes,游戏会尝试对不存在的国家执行子效果,轻则 tooltip 显示异常,重则引发存档错误,务必养成加存在性检查的习惯。

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

every_country_with_original_tag is well-suited for split-nation or puppet scenarios where you need to apply effects in bulk to all countries that once shared a given original TAG — for example, multiple successor states spawned from a civil war or dominion release. A typical use case is simultaneously granting a national idea or adjusting political relations for all German successors. You can also pair it with random_select_amount inside an event to randomly pick only a subset of matching countries, avoiding balance issues that come from triggering effects on every single one.

# Add war support and set a country flag for all countries whose original TAG is GER
every_country_with_original_tag = {
    original_tag_to_check = GER
    limit = {
        exists = yes
        has_war = yes
    }
    add_war_support = 0.10
    set_country_flag = received_ger_war_bonus
}

Synergy

  • original_tag: Can be used inside a limit block for additional filtering, confirming that the currently iterated country's original TAG matches expectations — useful in complex inheritance scenarios to prevent unintended triggers.
  • exists: Use inside limit to exclude already-dead countries (those no longer present in the game), preventing effects from being applied to non-existent scopes and causing errors.
  • add_ideas: The most common bulk operation target — uniformly add national ideas to all qualifying successor states to achieve synchronized policy effects.
  • set_country_flag: Pair with this to stamp each matched country with an individual flag, which subsequent events or triggers can check one by one to implement chained logic.

Common Pitfalls

  1. Omitting the original_tag_to_check field: This is a mandatory core parameter. Leaving it out means the effect cannot correctly filter target countries, typically causing the script to silently fail or throw an error. Beginners often mistake it for an optional limit condition and write original_tag = XXX inside the limit block instead — but the original_tag trigger inside limit and the external original_tag_to_check parameter operate at different layers and are not interchangeable.
  2. Applying effects to already-dead scopes: If you do not include exists = yes inside limit, the game will attempt to execute child effects on countries that no longer exist. At best this causes abnormal tooltip display; at worst it corrupts the save file. Always make a habit of adding an existence check.