trigger · state
Definition
- Supported scope:
STATE - Supported target:
THIS,ROOT,PREV,FROM,CAPITAL
Description
check state id
stateSTATETHIS, ROOT, PREV, FROM, CAPITALcheck state id
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.
The state trigger is most commonly used when you need to precisely specify a condition for a particular province or state block, such as in decisions or events to restrict triggering only when the scope points to a specific state ID. For example, in an "Occupy Berlin" decision, you can use it to verify whether the current state being operated on is Berlin's state:
# Within a state scope (such as results from every_neighbor_state iteration)
limit = {
state = 64 # 64 is Berlin's state ID
is_controlled_by = ROOT
}
[is_controlled_by](/wiki/trigger/is_controlled_by): Most commonly paired; confirms the specified state is simultaneously controlled by a specific nation, avoiding logic errors from checking only ID without actual control status.[is_core_of](/wiki/trigger/is_core_of): Used in combination to determine whether the state is also a core of a certain nation, commonly used in territorial claims or annexation logic.[has_state_flag](/wiki/trigger/has_state_flag): After confirming the state ID, use this to further check whether a specific script flag has been set, enabling multi-stage task chains.[set_state_flag](/wiki/effect/set_state_flag): Paired in effect blocks; when the trigger confirms the state ID matches, flag that state to prevent repeated triggering.state trigger only works within STATE scope. Beginners often write state = 64 directly in country event options without first switching to state scope (such as using 64 = { ... } or every_state = { limit = { state = 64 } }), causing script errors or permanent failure to trigger.state = field will not error but the logic will always be false. During debugging, carefully cross-reference map/definition.csv and history/states/ files to verify the correct IDs.