Hands-On Usage
resource_count_trigger is commonly used in focuses, decisions, or events to check whether a state or nation possesses sufficient strategic resources, thereby unlocking specific rewards or branching story paths. For example, in industry-building mods, you can require players to accumulate a certain amount of steel before opening decision branches for heavy industry upgrades.
# Example available block in a decision: ensures the nation has at least 50 units of steel to proceed
available = {
resource_count_trigger = {
resource = steel
amount > 50
}
}
Synergy
[free_building_slots](/wiki/trigger/free_building_slots): Simultaneously checks for available building slots, combining with resource quantity detection to ensure players have both sufficient resources and space before executing industrial decisions.
[add_resource](/wiki/effect/add_resource): Used as a counterpart operation in effect blocks—after trigger confirms insufficient resources, add_resource supplements them, creating a "top up if insufficient" conditional reward logic.
[has_resources_rights](/wiki/trigger/has_resources_rights): Verifies whether a nation possesses resource extraction rights for a given state; pairing with resource_count_trigger distinguishes between "has resources but no extraction rights" and "actively utilizing resources" gameplay states.
[controls_state](/wiki/trigger/controls_state): Typically perform control checks before resource quantity checks to prevent players from bypassing resource accumulation mechanics by occupying others' states.
Common Pitfalls
- Confusing STATE and COUNTRY scope: Under STATE scope, the trigger only counts that single state's resources; under COUNTRY scope, it counts the national total. Beginners often write thresholds in focuses (COUNTRY scope) based on single-state expectations, resulting in conditions that never activate or are overly permissive.
- Conflating resource units with actual output:
resource_count_trigger detects base resource slot quantities (the raw resource values on the map), not the player's actual usable amount after trade and requisition adjustments. Using it as an approximate "stockpile" creates judgment errors; clarify this distinction based on design intent.