trigger · state_population_k
Definition
- Supported scope:
STATE - Supported target:
none
Description
check the population in the state in thousands (use to avoid variable overflows)
state_population_kSTATEnonecheck the population in the state in thousands (use to avoid variable overflows)
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
state_population_k 常用于人口门槛检测场景,例如判断某地区是否拥有足够人口才允许建造特定设施、触发移民事件或解锁特定决策。与 state_population 相比,它以千为单位传入数值,可有效避免大数字在脚本变量运算中溢出。
# 仅当州人口超过 500,000(即 500k)时才允许执行该决策
available = {
state_population_k > 500
}
[state_population](/wiki/trigger/state_population):两者功能相近,当需要精确到个位的小人口数值比较时可改用此 trigger,与 state_population_k 搭配可分层做粗细两级判断。[has_state_category](/wiki/trigger/has_state_category):人口往往与州等级强相关,配合检查州类别可构建更严密的条件(如"大城市且人口超过阈值")。[set_state_category](/wiki/effect/set_state_category):在 effect 块中根据人口条件自动升降州类别,是最典型的联动写法——先用 state_population_k 判断,再用此 effect 改变等级。[compliance](/wiki/trigger/compliance):人口规模与顺从度常共同决定占领政策收益,两者联用可筛选出"人多且顺从"的高价值州。1000000)直接填入,但该 trigger 以千为单位,正确写法是 state_population_k > 1000,填原始数值会导致条件永远不成立或逻辑错误。state_population_k 只能在 STATE scope 下使用,若在 COUNTRY 或 CHARACTER scope 内直接调用会报错,需先用 any_owned_state/every_state 等方式切换到正确 scope 后再使用。