Wiki

trigger · has_resources_in_country

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

checks for amount of resources in country (the balance by default)
	Example:
	```
	has_resources_in_country = {
		resource = chromium
		amount > 10
		only_imported = no # (optional, default: no) checks only imported resources instead of country balance
		extracted = no # (optional, default: no) checks extracted amount instead of country balance
		buildings = no # (optional, default: no) checks only amount from local buildings instead of country balance
	}
	```

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

Commonly used to check whether a nation possesses sufficient strategic resource reserves, thereby unlocking specific decisions, national focuses, or event options. For example, in resource diplomacy mods, you can detect whether a nation's domestic chromium or rubber surplus is adequate to trigger trade negotiation events; it can also be combined with production mods to require players to accumulate a certain amount of rare earth resources before unlocking special tech trees.

# Decision is only available when domestic chromium balance exceeds 10
available = {
    has_resources_in_country = {
        resource = chromium
        amount > 10
    }
}

Synergy

  • [building_count_trigger](/wiki/trigger/building_count_trigger): Often works alongside this trigger as a decision prerequisite, simultaneously checking resource quantities and building levels to prevent players from triggering advanced industrial decisions when infrastructure is insufficient.
  • [add_resource](/wiki/effect/add_resource): Once resource conditions are met, further adjust resource quantities through effects, forming a complete logical loop of "detection-consumption" or "detection-reward".
  • [add_ideas](/wiki/effect/add_ideas): Grant corresponding national spirits or industrial bonuses when resource reserves meet the threshold, simulating the narrative flow of "abundant resources → industrial upgrade".
  • [has_built](/wiki/trigger/has_built): Combined with checking whether mining stations have been constructed; when used together with the buildings = yes parameter, the semantics become more complete, allowing distinction between "output from domestic buildings" and "national total balance".

Common Pitfalls

  1. Confusing the extracted and buildings parameters: extracted = yes checks the total amount extracted nationwide, while buildings = yes only counts domestic domestic building output; both bypass normal trade balance logic. Beginners often mix the two up, causing conditions to unexpectedly fail or succeed when large quantities of imported resources are present.
  2. Forgetting this trigger is only valid under COUNTRY scope: If placed in a limit block under STATE scope (for example, within every_owned_state), the script won't error but the judgment target will point to the wrong scope, creating hard-to-detect logic flaws; always evaluate at the national level before entering state loops.