Hands-On Usage
Commonly used to check whether a country and its subject nations collectively meet resource stockpile requirements. For example, in the available block of a decision or national focus to restrict access to specific technology paths only for nations with sufficient chromium production. The flexibility of the collection field makes it suitable for multi-party resource pool detection rather than simply checking domestic reserves.
available = {
has_resources_in_collection = {
collection = {
game:scope
operators = { country_and_all_subjects }
}
resource = chromium
amount > 20
extracted = yes
}
}
Synergy
[count_in_collection](/wiki/trigger/count_in_collection): Similarly accepts collection syntax and can first count members within the collection that meet conditions, then combine with this trigger to verify total resource volume, forming a dual threshold of "headcount + resources".
[any_subject_country](/wiki/trigger/any_subject_country): When needing to further refine which subject nation provided the resources, use it to iterate through subjects one by one, complementing the aggregate results of this trigger's collection.
[add_resource](/wiki/effect/add_resource): Commonly found in effect blocks: upon triggering conditions being met, append resources to specific regions, forming a complete logic loop of "detect shortage → supplement" with this trigger.
[create_import](/wiki/effect/create_import): If this trigger determines resources are insufficient, use this effect in the else branch to automatically create import agreements to fill the gap.
Common Pitfalls
extracted and buildings are mutually exclusive yet filled simultaneously: Only one can be chosen; simultaneous appearance will cause script errors or undefined behavior. When both are omitted, the default checked value is the nation's resource balance, and the three modes have different meanings—be sure to explicitly select based on actual requirements.
collection syntax missing operators: Writing only game:scope without the operators sub-block causes the collection to degenerate into containing only the current nation itself, preventing subject or ally resources from being included in the calculation, resulting in a silent bug with understated results.