Wiki

effect · reset_province_name

Definition

  • Supported scope:any
  • Supported target:none

Description

reset name of a province back to localization one.

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

reset_province_name is commonly used in dynamic naming mods. When a country loses control of a province or a specific event concludes, it restores province names that were previously customized via set_province_name back to their default localization values. For example, in a war-end event option to restore the names of occupied provinces:

# In an option block of a war-end event, restore the original name of a province
option = {
    name = my_event.1.a
    # Assuming the current scope has already been switched to the target province via trigger
    reset_province_name = yes
}

Synergy

  • [set_province_name](/wiki/effect/set_province_name) — Forms a complete "set / revert" lifecycle with reset_province_name. Use it first to apply a custom name, then use reset_province_name at the appropriate moment to undo it.
  • [if](/wiki/effect/if) — Usually requires conditional branching to check whether the conditions for name restoration are met (such as occupier change, event flag, etc.), preventing logic confusion from unconditional resets.
  • [set_global_flag](/wiki/effect/set_global_flag) / [has_global_flag](/wiki/trigger/has_global_flag) — Pair with global flags to track the "whether custom naming has been applied" state, then check on the trigger side before deciding whether to execute the reset, preventing duplicate or missed calls.
  • [hidden_effect](/wiki/effect/hidden_effect) — Wrap reset_province_name inside a hidden effect block to avoid displaying meaningless province name restoration information in event logs or tooltips, keeping the UI clean.

Common Pitfalls

  1. Incorrect scope targeting: reset_province_name operates on province scope rather than state scope. Beginners often call it directly under state scope, resulting in ineffective scripts or errors. You must first correctly switch to the specific province through iteration or event targeting.
  2. Missing restoration timing: After setting a custom name with set_province_name in a mod, if you fail to call reset_province_name in the corresponding "undo event" or power transfer logic, the custom name will persist permanently and won't automatically revert even if control changes to another country.