Wiki

trigger · has_resources_rights

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:none

Description

Checks for resources rights in state.Warning! this always returns false if the state has no resource.
Example:
has_resources_rights = {
	state = 60 # optional - can be used in state scope instead
	receiver = GER # optional - can be used in country scope instead
	resources = {steel oil} # optional - if not provided checks all resources.

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

has_resources_rights is commonly used to verify whether a country holds extraction rights to resources in a specific state. Typical scenarios include: checking if a puppet state continues to supply resources to its overlord, or validating whether a resource agreement is active before triggering subsequent effects in events/decisions. The following example checks in COUNTRY scope whether Germany holds steel and oil rights in state 60:

# Usage in COUNTRY scope (from Germany's perspective)
trigger = {
    has_resources_rights = {
        state = 60
        receiver = GER
        resources = { steel oil }
    }
}

Synergy

  • [resource_count_trigger](/wiki/trigger/resource_count_trigger): Use resource_count_trigger first to confirm the target state actually contains the resource (avoiding the pitfall where "no resource in state always returns false"), then use has_resources_rights to check rights ownership. These two form a safe double-gate check.
  • [add_resource](/wiki/effect/add_resource): When rights verification returns false, you can use add_resource in an else branch to adjust resource quantities in the state, indirectly affecting the preconditions for subsequent rights logic.
  • [controls_state](/wiki/trigger/controls_state): When used together with controls_state, you can distinguish between "physical occupation" and "resource rights"—two different forms of control. This prevents the logical error of treating occupation as equivalent to holding extraction rights.
  • [create_import](/wiki/effect/create_import): After confirming resource rights exist, pair it with create_import to establish a formal import agreement, forming a complete "verify rights → establish trade" workflow.

Common Pitfalls

  1. Overlooking the "state with no resources always returns false" premise: If the target state's corresponding resource quantity is 0, this trigger will never return true regardless of conditions. Beginners often mistake this for a syntax error and repeatedly debug script logic. Always use resource_count_trigger for preliminary validation first.
  2. Mixing STATE/COUNTRY scope parameters: In STATE scope, you don't need to fill state; in COUNTRY scope, you don't need to fill receiver. However, if both parameters are omitted simultaneously, the game cannot locate the target and the condition silently fails. Always retain the appropriate locating parameters based on your current scope.