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
}
}
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_state_owner_to 常用于事件或决议触发领土转让的场景,例如和平谈判后将某省份移交给指定国家,或在内战/分裂事件中动态重新分配领土归属。注意它只改变所有权(owner),不自动改变控制权(controller),如需同步控制权需额外处理。
# 在事件选项中,将美国一个随机核心州移交给加拿大
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):所有权转移后控制权不会自动跟随,通常需要同时调用此命令确保两者一致,避免出现"敌占领土"的异常状态。[add_core_of](/wiki/effect/add_core_of):转让领土时,若希望接收方对该州拥有核心,需配合此命令添加,否则接收方会将其视为非核心占领地。[remove_core_of](/wiki/effect/remove_core_of):与上条对应,在转让后移除原所有国对该州的核心,防止其立即产生收复战争动机。[is_owned_by](/wiki/trigger/is_owned_by):在 trigger 块中用于验证转让是否成功,或在转让前判断目标州当前归属,避免重复执行导致逻辑错误。set_state_owner_to 会同时更新控制权,实际上若该州由第三方控制,转让后仍会显示为被占领状态,必须搭配 set_state_controller_to 才能彻底移交。GER = { set_state_owner_to = ... })下会报错或静默失效,需先通过 random_core_state、every_neighbor_state 等进入具体州的 scope 再调用。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.