Wiki

effect · every_allied_country

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every Allied Country different from the one in scope (or `random_select_amount` of random country if specified) that fulfills the `limit` trigger.
`tooltip` can be added to override tooltip title (supports [bindable localization](script_concept_documentation.md#bindable-localization)).
By default the effects are only displayed once, you may display them for each matching country with display_individual_scopes.

### Example

ENG = { every_allied_country = { tooltip = my_loc_key # Optional bindable localization random_select_amount = 3 # Optional display_individual_scopes = yes # Optional - default = no limit = my_limit_trigger # Optional ... country scope effects ... } }

实战 · 配合 · 坑

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

实战用法

every_allied_country 常用于阵营联动场景,例如当宿主国完成某科研或通过焦点后,批量给所有盟友提供援助、设置标记或调整关系。也适合在战争结束事件中对所有同盟国统一执行奖励或惩罚逻辑。

GER = {
    every_allied_country = {
        limit = {
            has_war = yes
            is_in_faction = yes
        }
        add_war_support = 0.05
        add_stability = 0.03
        set_country_flag = received_axis_bonus
    }
}

配合关系

  • any_allied_country:常先用此触发器判断是否存在满足条件的盟友,再用 every_allied_country 批量执行,避免无效调用。
  • add_ideas:对每个盟友施加同一国策或想法,是批量统一阵营 buff 的经典搭配。
  • has_war:在 limit 块内过滤出真正参战的盟友,避免将效果误触发到和平状态的小国。
  • set_country_flag:给遍历到的每个盟友打标记,配合后续事件或 has_country_flag 检测实现阶段性逻辑。

常见坑

  1. 忘记 scope 方向every_allied_country 内部已切换到盟友 scope,若仍想引用原始国家的数据(如宿主国的 flag),需先在外层保存或使用 ROOT/PREV 引用,否则条件和效果都会作用在被迭代的盟友身上而非宿主国。
  2. every_country 混用:新手常误用 every_country 遍历所有国家,再在 limit 里加盟友条件,这会导致性能浪费且 is_ally_with 等触发器需要额外传参;直接使用 every_allied_country 已隐含"与 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

every_allied_country is most commonly used in faction-wide coordination scenarios — for example, after the host country completes a research project or passes a national focus, you can use it to bulk-grant aid, set flags, or adjust relations for all allies at once. It is also well-suited for end-of-war events where you want to apply uniform reward or penalty logic across every member of the alliance.

GER = {
    every_allied_country = {
        limit = {
            has_war = yes
            is_in_faction = yes
        }
        add_war_support = 0.05
        add_stability = 0.03
        set_country_flag = received_axis_bonus
    }
}

Synergy

  • any_allied_country: Typically used first to check whether any ally meets the desired conditions before calling every_allied_country for bulk execution, avoiding unnecessary iterations.
  • add_ideas: Applies the same national spirit or idea to every ally — the classic pattern for giving the entire faction a uniform buff.
  • has_war: Used inside a limit block to filter down to allies that are actually at war, preventing effects from accidentally firing on peaceful minor nations.
  • set_country_flag: Stamps a flag on each iterated ally, enabling phased logic in subsequent events or has_country_flag checks.

Common Pitfalls

  1. Forgetting scope direction: Inside every_allied_country the scope has already switched to the ally. If you still need to reference data from the original country (such as a host-nation flag), you must either save it in an outer scope beforehand or use ROOT/PREV to refer back to it — otherwise conditions and effects will evaluate against the iterated ally rather than the host.
  2. Mixing it up with every_country: Beginners often mistakenly use every_country to loop over all countries and then add ally conditions inside a limit block. This wastes performance and requires extra arguments for triggers like is_ally_with. Using every_allied_country directly already implies the "is allied with the current scope country" constraint, so no additional filtering is needed.