trigger · threat
Definition
- Supported scope:
any - Supported target:
none
Description
check the global threat value (world tension). 0-1 value
threatanynonecheck the global threat value (world tension). 0-1 value
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
threat 常用于判断当前全球紧张度是否达到某个阈值,从而触发事件、解锁决策或改变 AI 行为,例如在紧张度高于特定水平时允许小国加入防御同盟,或在低紧张度下限制某些激进决策的可用性。
# 决策:仅在全球紧张度超过 50% 时可用
available = {
threat > 0.5
}
[or](/wiki/trigger/or) — 常与 threat 组合,允许在多个紧张度区间或其他条件满足任一时触发逻辑,例如"高紧张度或已处于战争状态"。[date](/wiki/trigger/date) — 与日期条件联用,限定某段历史时期内紧张度判断才生效,避免在游戏早期或晚期产生意外触发。[any_country](/wiki/trigger/any_country) — 在遍历国家时搭配 threat 做全局过滤,只对"世界局势紧张时"的国家执行特定检查。[if](/wiki/effect/if) — 在 effect 块中通过 if = { limit = { threat > 0.x } } 实现条件性执行,是将该 trigger 嵌入 effect 上下文的标准写法。threat 的取值范围是 0 到 1(浮点数),新手常误写成 threat > 50 导致条件永远为假,正确写法是 threat > 0.5。threat 是全局值,不接受任何 target,若写成类似 threat = { target = GER value > 0.3 } 会直接报错,应直接在任意 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.
threat is commonly used to check whether the current global tension reaches a certain threshold, thereby triggering events, unlocking decisions, or altering AI behavior. For example, it can allow minor nations to join defensive alliances when tension exceeds a specific level, or restrict certain aggressive decisions when tension is below a threshold.
# Decision: only available when global tension exceeds 50%
available = {
threat > 0.5
}
[or](/wiki/trigger/or) — Often combined with threat to allow logic to trigger when any of multiple tension ranges or other conditions are met, for example "high tension OR already at war".[date](/wiki/trigger/date) — Used together with date conditions to limit tension checks to specific historical periods, preventing unexpected triggers in early or late game.[any_country](/wiki/trigger/any_country) — Paired with threat when iterating through countries for global filtering, executing specific checks only on countries when "world tension is high".[if](/wiki/effect/if) — Within effect blocks, implement conditional execution via if = { limit = { threat > 0.x } }, which is the standard way to embed this trigger within an effect context.threat ranges from 0 to 1 (a float), and beginners often mistakenly write threat > 50 causing the condition to always be false. The correct syntax is threat > 0.5.threat is a global value and accepts no targets. Writing something like threat = { target = GER value > 0.3 } will throw an error. It should be used directly and flatly in any scope.