Wiki

effect · change_tag_from

Definition

  • Supported scope:any
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Changes player to other country

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

change_tag_from is commonly used in scripted events to implement "player perspective switching," such as seamlessly transferring the player to a newly established puppet state after its creation, or shifting control to a breakaway faction in secession scenarios. The following example demonstrates switching the player from the current nation to a target nation within an event option:

# Within an option block of a country_event
option = {
    name = my_event.1.a
    # Execute other state changes first...
    change_tag_from = ROOT   # Transfers the player who previously controlled ROOT to now control the current scope nation
}

Synergy

  • [hidden_effect](/wiki/effect/hidden_effect): Typically wrap change_tag_from inside hidden_effect to avoid triggering unnecessary UI notifications and make the transition smoother.
  • [save_global_event_target_as](/wiki/effect/save_global_event_target_as): Save the original nation as a global event target before switching, allowing continued execution of effects on the old nation after the switch completes.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Since the switching behavior may not be immediately intuitive to players, pair this command to provide a user-friendly explanation in the UI.
  • [country_exists](/wiki/trigger/country_exists): Use this trigger to validate that the target nation exists before executing the switch, preventing script errors or logic failures caused by the target nation not yet being created.

Common Pitfalls

  1. Reversed scope direction: The semantics of change_tag_from mean "transfer the player who was controlling the nation specified by <target> to now control the current scope nation," not "transfer the current scope player to target." Beginners often swap scope and target, resulting in the switch targeting the opposite nation entirely.
  2. Calling under an AI nation's scope: If the current scope nation has no human player controlling it, the effect fails silently with no error message, making it extremely difficult to debug. Always confirm before calling that the scope nation is actually under player control, or protect the call with conditional checks.