effect · set_state_owner_to
Definition
- Supported scope:
STATE - Supported target:
THIS
Description
Set owner of a state to a given country
Example:\n"
USA {
random_core_state = {
set_state_owner_to = JAM
}
}
set_state_owner_toSTATETHISSet owner of a state to a given country
Example:\n"
USA {
random_core_state = {
set_state_owner_to = JAM
}
}
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_to is commonly used in event or decision scenarios where territorial transfer is triggered, such as handing over a province to a designated country after peace negotiations, or dynamically reassigning territory ownership during civil war or secession events. Note that it only changes ownership (owner) and does not automatically change control (controller). Additional handling is required if you need to synchronize control.
# In an event option, transfer a random core state of the USA to Canada
country_event = {
id = example.1
option = {
name = example.1.a
USA = {
random_core_state = {
set_state_owner_to = CAN
set_state_controller_to = CAN
}
}
}
}
[set_state_controller_to](/wiki/effect/set_state_controller_to): After ownership transfer, control does not automatically follow. You typically need to call this command simultaneously to ensure both are consistent, avoiding the anomalous state of "enemy-occupied territory".[add_core_of](/wiki/effect/add_core_of): When transferring territory, if you want the recipient to have a core on that state, use this command to add it. Otherwise, the recipient will treat it as non-core occupied land.[remove_core_of](/wiki/effect/remove_core_of): Corresponding to the above, remove the original owner's core on that state after transfer to prevent them from immediately generating a war goal for reclamation.[is_owned_by](/wiki/trigger/is_owned_by): In trigger blocks, use this to verify whether the transfer was successful, or check the current ownership of the target state before transfer to avoid repeated execution that could cause logic errors.set_state_owner_to will simultaneously update control. In reality, if the state is controlled by a third party, it will still display as occupied after transfer. You must pair it with set_state_controller_to to complete the transfer.GER = { set_state_owner_to = ... }) will cause an error or silently fail. You must first enter the specific state scope via random_core_state, every_neighbor_state, or similar commands before calling it.