Wiki

effect · random_country_with_original_tag

Definition

  • Supported scope:any
  • Supported target:none

Description

Executes children effects on a random country with original tag. Example:
random_country_with_original_tag = { 
  original_tag_to_check = ENG # the effect will only run on countries that has this original tag 
  limit = { always = yes } # a limit can be defined to limit scopes
  # ... effects to execute 
}

实战 · 配合 · 坑

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

实战用法

random_country_with_original_tag 常用于需要对某个历史国家的"继承者"执行操作的场景,例如内战后出现多个带有相同原始标签的派系国家,或在事件中对"真正的"某国(无论当前标签如何)随机选取一个进行外交/资源操作。典型场景是给所有英国分裂体中随机一个施加效果,而无需硬编码其动态标签。

# 事件效果:随机找一个原始标签为ENG的国家,若其正在参战则给予稳定度奖励
random_country_with_original_tag = {
    original_tag_to_check = ENG
    limit = {
        has_war = yes
        exists = yes
    }
    add_stability = 0.05
    add_war_support = 0.05
}

配合关系

  • original_tag:在 limit 块内可进一步校验当前 scope 国家的原始标签,与 original_tag_to_check 参数形成双重过滤,确保逻辑精确。
  • exists:在 limit 中检查目标国家是否仍然存在于游戏中,避免对已被消灭的国家执行效果导致报错或静默失败。
  • has_war:常置于 limit 内,限定只对当前处于战争状态的原始标签国家执行效果,配合战争事件链使用。
  • add_stability:典型的执行体效果命令,代表在选中的随机国家上施加任意国家级修改,是该 effect 最常见的内容填充。

常见坑

  1. 遗漏 original_tag_to_check 字段:该字段是本 effect 的核心必填参数,若省略则行为未定义或遍历范围不符合预期,新手容易误以为 limit 中的 original_tag trigger 可以替代它,但两者作用层级不同,original_tag_to_check 是筛选候选池的前置条件,limit 是在候选池上的额外过滤。
  2. 误用 tag 代替 original_tag 做校验:在 limit 内用 tag = ENG 只会匹配当前游戏标签恰好是 ENG 的国家,无法覆盖内战或傀儡产生的同原始标签衍生国,应改用 original_tag = ENG trigger 才能与 original_tag_to_check 的筛选逻辑保持一致。

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

random_country_with_original_tag is typically used when you need to perform operations on a "successor" of a historical nation — for example, when multiple faction countries sharing the same original tag emerge after a civil war, or when an event needs to randomly select one instance of a "true" nation (regardless of its current tag) for diplomatic or resource operations. A classic use case is applying an effect to a random splinter of Britain without hard-coding any of its dynamic tags.

# Event effect: randomly find a country with original tag ENG, and if it is at war, grant it a stability bonus
random_country_with_original_tag = {
    original_tag_to_check = ENG
    limit = {
        has_war = yes
        exists = yes
    }
    add_stability = 0.05
    add_war_support = 0.05
}

Synergy

  • original_tag: Can be used inside the limit block to further verify the original tag of the current scoped country, forming a double filter together with the original_tag_to_check parameter to ensure precise logic.
  • exists: Used in limit to check whether the target country still exists in the game, preventing errors or silent failures when effects are applied to already-eliminated nations.
  • has_war: Commonly placed inside limit to restrict the effect to original-tag countries that are currently at war, useful in conjunction with war-related event chains.
  • add_stability: A typical effect command used as the execution body, representing any country-level modification applied to the randomly selected nation — the most common content found inside this effect.

Common Pitfalls

  1. Omitting the original_tag_to_check field: This is the core required parameter of this effect. Leaving it out results in undefined behavior or an unintended candidate pool. Beginners often mistakenly assume that an original_tag trigger inside limit can substitute for it, but the two operate at different levels: original_tag_to_check is a prerequisite that defines the candidate pool, while limit is an additional filter applied on top of that pool.
  2. Using tag instead of original_tag for validation: Writing tag = ENG inside limit will only match countries whose current in-game tag is exactly ENG, and will not cover derived nations sharing the same original tag that were created through civil wars or puppeting. You should use the original_tag = ENG trigger instead, so that the filtering logic stays consistent with original_tag_to_check.