trigger · controls_state
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,CAPITAL
Description
check controller for state(s)
controls_stateCOUNTRYTHIS, ROOT, PREV, FROM, CAPITALcheck controller for state(s)
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
controls_state 常用于判断某国是否实际控制了特定州,从而解锁后续决策、国策或事件分支——例如在领土扩张 mod 中,只有当玩家控制了目标州之后,才允许触发"整合占领区"决策。注意它检查的是控制权而非所有权,适合处理战时临时占领的逻辑。
# 在决策的 available 块中:只有控制了特定州才可执行
available = {
controls_state = 42 # 42 为目标 state_id
}
# 也可以在 trigger 块中检查多个州
trigger = {
controls_state = 42
controls_state = 43
}
[any_controlled_state](/wiki/trigger/any_controlled_state) — 当需要模糊查询("控制了任意一个满足条件的州")时与 controls_state 互补,前者适合范围遍历,后者适合精确 id 检查。[divisions_in_state](/wiki/trigger/divisions_in_state) — 确认控制权的同时进一步核实该州内是否有兵力驻扎,常用于"占领并驻防"类双重条件决策。[add_state_core](/wiki/effect/add_state_core) — 确认控制之后为该州添加核心,是"先控制、再宣示主权"流程的标准搭档 effect。[has_defensive_war](/wiki/trigger/has_defensive_war) — 在战时事件中,先用 controls_state 确认前线州的归属,再结合是否处于防御战来决定事件走向。controls_state 等同于"拥有"该州,但战争中敌方可能控制你名义上拥有的州,或你控制了属于他国的州——请根据实际需要选择 controls_state(控制方)还是配合 any_owned_state / is_owned_by(所有权)使用。controls_state,脚本不会报错但逻辑对象错误,需要先用 OWNER 或 FROM 等切回国家 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.
controls_state is commonly used to check whether a country actually controls a specific state, thereby unlocking subsequent decisions, focuses, or event branches—for example, in territorial expansion mods, only after the player controls the target state is the "Integrate Occupied Territory" decision allowed to trigger. Note that it checks control rather than ownership, making it suitable for handling wartime temporary occupation logic.
# In the available block of a decision: only executable if the specific state is controlled
available = {
controls_state = 42 # 42 is the target state_id
}
# Can also check multiple states in a trigger block
trigger = {
controls_state = 42
controls_state = 43
}
[any_controlled_state](/wiki/trigger/any_controlled_state) — When fuzzy querying is needed ("controls any state meeting conditions"), it complements controls_state; the former suits range iteration while the latter suits exact ID checks.[divisions_in_state](/wiki/trigger/divisions_in_state) — Confirms control while additionally verifying whether troops are garrisoned in that state; commonly used for dual-condition decisions like "occupy and garrison."[add_state_core](/wiki/effect/add_state_core) — After confirming control, adds a core to that state; the standard companion effect in a "control first, then assert sovereignty" workflow.[has_defensive_war](/wiki/trigger/has_defensive_war) — In wartime events, first use controls_state to confirm front-line state ownership, then combine with whether in a defensive war to determine event outcomes.controls_state is equivalent to "owning" a state, but in war the enemy may control a state nominally owned by you, or you may control a state belonging to another country—choose controls_state (controller) or combine with any_owned_state / is_owned_by (ownership) based on actual needs.OWNER or FROM before calling it.