Hands-On Usage
set_state_controller_to is commonly used in liberation wars, puppet state establishment, or event-triggered scenarios to transfer actual control of a state to a specific country without changing its sovereignty. For example, in peace conference scripts or civil war events, you can reassign regional control to a newly formed regime:
# Civil war resolution event: transfer core state control to rebel faction
country_event = {
id = civil_war.10
immediate = {
random_core_state = {
limit = { is_controlled_by = ROOT }
set_state_controller_to = REB
}
}
}
Synergy
[set_state_owner_to](/wiki/effect/set_state_owner_to): Control and ownership typically need to be set in sync. Changing only the controller without updating the owner leaves the state in an "occupied" status. Using both commands together ensures a complete land transfer.
[transfer_state_to](/wiki/effect/transfer_state_to): If you need to transfer both ownership and control while triggering related diplomatic logic, use this command instead or as a follow-up to avoid leaving orphaned ownership while only changing the controller.
[is_controlled_by](/wiki/trigger/is_controlled_by): Use this trigger in limit blocks to confirm the current controller before executing control changes, preventing unintended modifications to the wrong country. This is especially critical when performing batch operations with every_neighbor_state.
[set_occupation_law](/wiki/effect/set_occupation_law): After changing the controlling nation, the new controller's occupation law does not update automatically. You must set it manually to avoid inheriting the previous controller's occupation policies.
Common Pitfalls
- Confusing "controller" with "owner": This command only changes the controller, not the owner. Beginners often mistakenly believe the state "belongs" to the target country after execution, but sovereignty actually remains with the original owner. The target country only has occupier status, and resistance/compliance mechanics still function based on the original owner as the baseline.
- Calling outside STATE scope: This command must execute within a state-level scope. If you write
set_state_controller_to = XXX directly under a country scope without first entering a state scope via random_core_state, every_state, etc., the script will silently fail or produce errors. Game logs often provide unclear feedback, making debugging difficult.