trigger · all_state
Definition
- Supported scope:
any - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
check if all states meets the trigger. tooltip=key can be defined to override title
all_stateanyTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALcheck if all states meets the trigger. tooltip=key can be defined to override title
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
all_state 常用于需要验证某个国家名下所有州都满足特定条件的场景,例如检查某国所有核心州是否都已被占领、所有目标省份是否都达到了特定建设等级。典型应用包括胜利条件判断、决议解锁条件或事件触发器。
# 检查 ROOT 控制的所有州是否都已达到合规度阈值并属于特定大区
focus = {
available = {
all_state = {
limit = { is_owned_by = ROOT }
compliance > 50
is_on_continent = europe
}
}
}
# 判断某国所有州是否都被己方完全控制(用于胜利事件)
trigger = {
all_state = {
limit = { is_core_of = GER }
is_fully_controlled_by = GER
}
}
all_state 互补,前者检查"至少一个",后者检查"全部",配合使用可构造精确的数量范围逻辑。all_state 内部,用于验证每个州的控制权归属。all_state 块内作子条件使用,批量检查所有目标州的合规度是否达标。limit 预筛范围:all_state 默认遍历游戏内全部州,若不加 limit 缩小范围,条件会对所有 1000+ 个州生效,极易因为荒野或中立州不满足条件而永远返回假,导致触发器永不成立。all_state 属于 any scope,可在大多数上下文调用,但其内部子触发器的 scope 已切换为州,此时若误用国家级 trigger(如直接写 has_war = yes)会因 scope 不匹配而报错或静默失败,需通过 OWNER / CONTROLLER 等目标跳转回国家 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.
all_state is commonly used when you need to verify that every state owned by a country meets a specific condition — for example, checking whether all of a nation's core states have been occupied, or whether all target provinces have reached a certain construction level. Typical applications include victory condition checks, decision unlock requirements, and event triggers.
# Check whether all states owned by ROOT have exceeded the compliance threshold and are on a specific continent
focus = {
available = {
all_state = {
limit = { is_owned_by = ROOT }
compliance > 50
is_on_continent = europe
}
}
}
# Check whether all of a country's states are fully controlled by that country (used in victory events)
trigger = {
all_state = {
limit = { is_core_of = GER }
is_fully_controlled_by = GER
}
}
all_state: the former checks "at least one," the latter checks "all." Using them together lets you construct precise quantity-range logic.all_state to verify which country controls each individual state.all_state block to bulk-check whether all target states meet a compliance threshold.limit to pre-filter the scope: all_state iterates over every state in the game by default. Without a limit to narrow the range, the condition applies to all 1,000+ states, and it will almost certainly return false because wastelands or neutral states fail the condition — meaning the trigger will never fire.all_state is an any-scope trigger and can be called in most contexts, but the sub-triggers inside it have already switched scope to a state. If you mistakenly use a country-level trigger there (such as writing has_war = yes directly), it will cause a scope mismatch error or silently fail. You need to redirect back to a country scope first via targets such as OWNER or CONTROLLER before making that kind of check.