effect · set_state_owner
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
set owner for state
set_state_ownerCOUNTRYnoneset owner for state
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.
set_state_owner is commonly used in territory transfers, peace negotiation simulations, or scripted events to forcibly change the ownership of a state. For example, you can use it to have a country transfer a specific state to another nation upon event trigger. Note that it operates in COUNTRY scope and specifies the target state via the = { id = <state_id> } syntax.
# Germany returns Alsace to France in an event
GER = {
set_state_owner = {
id = 11 # Alsace-Lorraine state ID
owner = FRA
}
}
[add_state_core](/wiki/effect/add_state_core): After transferring territory, it is common practice to synchronously update core ownership to prevent the original owner from retaining cores and triggering AI reconquest behavior.[add_state_claim](/wiki/effect/add_state_claim): If claims on the new territory have not yet been established, you can first add claims for the receiving nation to make the transfer more logically sound from a diplomatic perspective.[controls_state](/wiki/trigger/controls_state): In trigger checks, confirm that a country actually controls the state before executing ownership transfers, preventing severe desynchronization between ownership and control.[every_owned_state](/wiki/effect/every_owned_state): When bulk transferring multiple states, combine this with conditional filters to avoid the tedious approach of hardcoding individual state IDs.set_state_owner only changes the state's owner, not the actual military controller. If the state is still occupied by a third party's forces, control remains with the occupier. You must handle control logic separately; otherwise, the game will display an abnormal "occupied" status.add_state_core / removal of related modifiers and other adjustments; otherwise, the scripted effect will be rapidly undermined by AI behavior.