Wiki

trigger · all_subject_countries

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

check if all subject countries meet the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

all_subject_countries 常用于检查宗主国是否满足"所有附庸/傀儡全部达到某项条件"的前置要求,例如检查所有附庸国均已完成工业化或宣战前确认所有附庸都加入了战争。也适用于成就类 mod 中判断玩家是否已将所有附庸纳入同一阵营。

# 检查所有附庸国都拥有某项国策并已开战,才允许激活某决议
available = {
    all_subject_countries = {
        has_war = yes
        has_idea = war_economy
    }
}

配合关系

  • is_subject 配合使用,在附庸国自身的 scope 内进一步确认其附庸身份类型,避免误判盟友。
  • has_government 常嵌套在 all_subject_countries 内部,用于确认所有附庸均为同一政体,服务于意识形态扩散类 mod 的完成条件。
  • num_subjects 先用此 trigger 确认附庸数量大于 0,再调用 all_subject_countries,防止附庸为空时 all 系 trigger 默认返回真导致逻辑漏洞。
  • set_autonomy 配合使用:当 all_subject_countries 条件满足后,在 effect 块中批量调整附庸自治度。

常见坑

  1. 附庸为零时 all 系 trigger 返回真:当一个国家没有任何附庸时,all_subject_countries 的结果为真(空集的全称命题成立),新手往往误以为它会返回假,应先用 num_subjects > 0 作保护前置条件。
  2. scope 混用导致 target 失效all_subject_countries 只能在 COUNTRY scope 下使用,若写在 STATE 或 CHARACTER scope 内会静默失败;同时内部 THIS/ROOT 指向的是附庸国本身而非宗主国,需用 PREVFROM 才能回溯到宗主国的数据。

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

all_subject_countries is commonly used to check whether a overlord meets a prerequisite requiring that all subjects/puppets satisfy a given condition — for example, verifying that every subject has completed industrialization, or confirming that all subjects have joined a war before declaring one. It is also useful in achievement-style mods to determine whether the player has brought all subjects into the same faction.

# Only allow activating a decision when all subject countries are at war and have the war_economy idea
available = {
    all_subject_countries = {
        has_war = yes
        has_idea = war_economy
    }
}

Synergy

  • is_subject — use alongside all_subject_countries to further confirm the subject relationship type within the subject's own scope, preventing allies from being mistakenly matched.
  • has_government — frequently nested inside all_subject_countries to verify that every subject shares the same government type, serving as a completion condition for ideology-spread mods.
  • num_subjects — use this trigger first to confirm the subject count is greater than 0 before calling all_subject_countries, preventing the logical loophole where an all-type trigger returns true by default when the subject list is empty.
  • set_autonomy — use in tandem: once the all_subject_countries condition is satisfied, batch-adjust subject autonomy levels inside an effect block.

Common Pitfalls

  1. all-type triggers return true when there are zero subjects: When a country has no subjects at all, all_subject_countries evaluates to true (a universal proposition over an empty set is vacuously true). Beginners often assume it would return false in this case — always guard against this with a num_subjects > 0 precondition.
  2. Scope mixing causes target resolution to fail: all_subject_countries can only be used inside a COUNTRY scope; placing it inside a STATE or CHARACTER scope will cause it to fail silently. Additionally, THIS/ROOT inside the block refers to the subject country itself, not the overlord — use PREV or FROM to trace back to the overlord's data.