trigger · state_population
Definition
- Supported scope:
STATE - Supported target:
none
Description
check the population in the state
state_populationSTATEnonecheck the population in the state
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
state_population 常用于人口门槛类决策或事件,例如限定"仅在人口足够的州才能触发殖民/建设决策",或在抵抗运动脚本中判断占领区民众规模。配合占领法律和顺从度机制时,它能让某些政策选项只在大型人口州生效,避免逻辑上的不合理。
# 只有人口超过一定规模的州才能触发该决策
available = {
state_population > 500000
}
[has_state_category](/wiki/trigger/has_state_category):州的类别(城市/农村等)往往与人口规模强相关,两者组合可精确筛选"大城市州"场景,避免单独用人口数值时误命中非城区大州。[compliance](/wiki/trigger/compliance):在占领类 mod 中,高人口州的顺从度影响更显著,二者联用可设计"高人口且低顺从"触发镇压事件的条件链。[state_population_k](/wiki/trigger/state_population_k):当需要以千为单位做简洁比较时,可与本 trigger 互为替代或双重校验,确认数值逻辑一致。[add_manpower](/wiki/effect/add_manpower):人口判断通过后常紧接着执行征兵效果,人口越多的州给予的人力值越合理,配合使用可保持数值设计的叙事连贯性。state_population 只能在 STATE scope 下调用,若写在 COUNTRY scope 的 trigger 块里会静默失效或报错,务必确认外层 scope 已通过 any_state/every_state 等迭代切换至州。500000),而同类 trigger state_population_k 使用千为单位(如 500),两者混用时极易写错阈值,导致条件永真或永假。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.
state_population is commonly used in population threshold-based decisions or events, such as restricting "colonial/construction decisions can only trigger in states with sufficient population" or determining the scale of occupied populations in resistance movement scripts. When combined with occupation laws and compliance mechanics, it allows certain policy options to take effect only in large-population states, avoiding logical inconsistencies.
# Only states with population exceeding a certain threshold can trigger this decision
available = {
state_population > 500000
}
[has_state_category](/wiki/trigger/has_state_category): State categories (urban/rural, etc.) are often strongly correlated with population scale. Using both together enables precise filtering for "large city state" scenarios, avoiding false matches when relying solely on population values in non-urban large states.[compliance](/wiki/trigger/compliance): In occupation-focused mods, compliance of high-population states has a more significant impact. Using both together allows designing condition chains like "high population and low compliance" to trigger suppression events.[state_population_k](/wiki/trigger/state_population_k): When needing concise comparisons using thousands as the unit, it can serve as an alternative or dual verification against this trigger, ensuring numerical logic consistency.[add_manpower](/wiki/effect/add_manpower): After population checks pass, manpower effects typically follow immediately. States with larger populations yield manpower values more proportionately, and coordinated use maintains narrative coherence in numerical design.state_population can only be called within STATE scope. Writing it inside a trigger block in COUNTRY scope will silently fail or error. Always ensure the outer scope has been switched to state-level via iterators like any_state/every_state.500000), while the similar trigger state_population_k uses thousands as the unit (e.g., 500). Mixing the two easily leads to threshold errors, causing conditions to always be true or always false.