Wiki

trigger · has_country_custom_difficulty_setting

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Returns true if the game has any custom difficulty on the scope 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

This trigger is commonly used in mod scenarios related to custom difficulty systems. For example, after a player enables custom difficulty options for a nation, you can dynamically adjust that nation's research speed, factory output, or AI behavior. It can also be used in the available block of a focus or decision to restrict certain powerful options to only trigger on standard difficulty.

# Check whether custom difficulty is enabled in a country event trigger
country_event = {
    id = my_mod.1
    trigger = {
        has_country_custom_difficulty_setting = yes
        # Only countries with custom difficulty enabled will trigger this event
    }
    ...
}

Synergy

  • [has_country_flag](/wiki/trigger/has_country_flag): Use flags to record player difficulty choices first, then combine with this trigger for dual confirmation to avoid false positives.
  • [has_active_rule](/wiki/trigger/has_active_rule): Custom difficulty often comes with specific rule toggles; using both together allows precise differentiation between multiple difficulty configuration combinations.
  • [add_ideas](/wiki/effect/add_ideas): After detecting custom difficulty, dynamically balance nation attributes by adding ideas—this is the most common follow-up effect pattern.
  • [country_event](/wiki/effect/country_event): After confirming custom difficulty takes effect, trigger exclusive events to notify players of the current difficulty state or grant special rewards/penalties.

Common Pitfalls

  1. Scope misuse: This trigger can only be called within COUNTRY scope. Placing it in STATE or CHARACTER scopes will fail silently or throw errors. Beginners often forget to switch scopes when nesting is deep within limit blocks.
  2. Confusing "having custom difficulty" with "specific difficulty value": This trigger only returns whether custom difficulty settings exist; it does not judge the specific value or type of difficulty. To distinguish between different difficulty tiers, you must combine it with other flags or rules for fine-grained judgment—this trigger alone cannot complete the task.