trigger · has_ideology
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
has_ideology = stalinism - Checks if the current character has a country leader role matching the sub-ideology
has_ideologyCHARACTERnonehas_ideology = stalinism - Checks if the current character has a country leader role matching the sub-ideology
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_ideology 常用于在角色相关事件或国策中判断某个人物是否持有特定子意识形态,从而触发不同分支剧情,例如检测领袖是否为斯大林主义者来决定是否允许某条国策路线。在顾问、将领的 available 或事件 trigger 块中也常见,用于限制某些角色只在意识形态匹配时出现。
# 示例:国策的 available 块中检测当前角色意识形态
available = {
FROM = { # FROM 指向相关 CHARACTER scope
has_ideology = stalinism
}
}
[is_country_leader](/wiki/trigger/is_country_leader):通常先判断角色是否担任国家领袖,再用 has_ideology 验证其子意识形态,避免对非领袖角色做无意义的检查。[has_ideology_group](/wiki/trigger/has_ideology_group):两者互补——前者检查大意识形态组(如 communism),后者精确到子意识形态,常一起组合形成"宽窄"两层过滤。[add_country_leader_trait](/wiki/effect/add_country_leader_trait):在确认意识形态匹配后,立即给领袖附加对应特质,是事件与国策脚本中最常见的组合模式。[remove_country_leader_role](/wiki/effect/remove_country_leader_role) / [add_country_leader_role](/wiki/effect/add_country_leader_role):用 has_ideology 做条件门控,决定是否替换领袖角色,实现意识形态转变时的领袖交替逻辑。has_ideology 只能在 CHARACTER scope 下使用,直接写在国家 scope(如 country_event 的根 trigger 块)里会静默失败或报错,必须先用 ROOT/FROM/具体角色 tag 进入角色 scope。ideologies.txt 中定义的子意识形态 token(如 stalinism、fascism_ideology),大小写和下划线错误不会有明显报错,但条件永远为假,新手极易忽略。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.
has_ideology is commonly used in character-related events or national focuses to determine whether a specific character holds a particular sub-ideology, thereby triggering different story branches. For example, checking if a leader is a Stalinist to decide whether to allow a certain focus path. It's also frequently seen in the available or event trigger blocks of advisors and generals, where it restricts certain characters to appear only when their ideology matches.
# Example: Checking current character ideology in a focus' available block
available = {
FROM = { # FROM points to the relevant CHARACTER scope
has_ideology = stalinism
}
}
[is_country_leader](/wiki/trigger/is_country_leader): Typically check whether a character holds the position of country leader first, then use has_ideology to verify their sub-ideology, avoiding meaningless checks on non-leader characters.[has_ideology_group](/wiki/trigger/has_ideology_group): Both are complementary — the former checks broad ideology groups (e.g., communism), while the latter pinpoints sub-ideologies; they are often combined together to form a "broad-to-narrow" two-layer filter.[add_country_leader_trait](/wiki/effect/add_country_leader_trait): After confirming ideology match, immediately add corresponding traits to the leader; this is the most common combination pattern in events and focus scripts.[remove_country_leader_role](/wiki/effect/remove_country_leader_role) / [add_country_leader_role](/wiki/effect/add_country_leader_role): Use has_ideology as a conditional gate to decide whether to replace a leader character, implementing leader succession logic when ideology shifts.has_ideology can only be used under CHARACTER scope. Writing it directly in a country scope (such as in the root trigger block of country_event) will silently fail or error out. You must first enter character scope using ROOT/FROM/specific character tags.ideologies.txt file (e.g., stalinism, fascism_ideology). Case and underscore errors won't produce obvious error messages, but the condition will always evaluate to false—a common mistake for newcomers.