Wiki

trigger · num_subjects

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check the number of subjects of nation

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

num_subjects is commonly used to determine whether a nation possesses a sufficient number of subjects/puppets, thereby unlocking specific decisions, national focuses, or events—for example, in "Imperial Expansion"-style mods that require players to control a certain number of puppets before triggering an imperial declaration. It can also serve as a conditional threshold in AI strategies, preventing the AI from attempting warfare before it is fully prepared.

# Unlock the imperial declaration decision when the player owns at least 3 subjects
available = {
    num_subjects > 2
}

Synergy

  • [any_subject_country](/wiki/trigger/any_subject_country) — After confirming the subject count threshold is met, further filter whether a specific subject satisfies additional conditions (such as ideology or military strength), forming a dual verification of "quantity" and "quality."
  • [has_autonomy_state](/wiki/trigger/has_autonomy_state) — While the subject count reaches the target, also check the autonomy level of a particular subject, commonly used to control the trigger conditions for puppet promotion/demotion.
  • [every_subject_country](/wiki/effect/every_subject_country) — Once the quantity condition passes, use this effect to execute operations on all subjects in batch (such as adding ideas or transferring resources), logically forming a standard workflow of "check quantity first, then batch process."
  • [end_puppet](/wiki/effect/end_puppet) — Trigger reduction logic when there are too many subjects, forming an upper-limit protection mechanism with num_subjects to prevent the subject count from exceeding the scenario design ceiling.

Common Pitfalls

  1. Confusion with comparison operators: num_subjects must be paired with operators like > / < / =, and writing num_subjects = 3 directly means exactly equal to 3, not "at least 3." To express "at least," write num_subjects > 2. Beginners often introduce bugs where conditions never trigger due to this mistake.
  2. Incorrect scope object: This trigger can only be used in COUNTRY scope. Placing it mistakenly in STATE scope (such as within state loops in a limit block) causes script errors or silent failures. Always confirm that the current scope actually refers to a nation before use.