trigger · has_legitimacy
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
Check scope country legitimacy 0-100: Example has_legitimacy < 60
has_legitimacyCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALCheck scope country legitimacy 0-100: Example has_legitimacy < 60
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_legitimacy 常用于君主制或非民主政体的 mod 中,根据政权合法性高低触发不同的政治事件或限制某些决议的可用性,例如低合法性时禁止扩张决议、触发宫廷政变事件等。
# 决议:只有合法性足够高才能发起扩张运动
available = {
has_government = monarchism
has_legitimacy > 70
has_stability > 0.4
}
# 事件触发条件:合法性过低引发内部动乱
trigger = {
has_legitimacy < 40
has_war = no
}
trigger 块中作复合条件。has_government 限定适用范围可避免逻辑误判。has_government 限定政体就直接检测 has_legitimacy,在民主国家等不使用该机制的政体上条件可能始终返回固定值,导致逻辑失控或决议对所有国家意外可用。has_legitimacy < 60 表示"合法性低于 60 时为真",新手有时误写成 has_legitimacy > 60 却期望触发低合法性惩罚事件,导致效果完全相反且难以排查。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_legitimacy is commonly used in monarchy or non-democratic government mods to fire different political events or restrict the availability of certain decisions based on a regime's legitimacy level — for example, blocking expansion decisions at low legitimacy or triggering court coup events.
# Decision: expansion campaign only available when legitimacy is high enough
available = {
has_government = monarchism
has_legitimacy > 70
has_stability > 0.4
}
# Event trigger: low legitimacy causes internal unrest
trigger = {
has_legitimacy < 40
has_war = no
}
trigger block as a compound condition.has_government to narrow the applicable scope prevents logic errors and false positives.has_legitimacy without first gating on has_government, the condition may always return a fixed value for governments that don't use this mechanic (such as democracies), causing logic to spiral out of control or decisions to become unexpectedly available to all countries.has_legitimacy < 60 means "true when legitimacy is below 60." Beginners sometimes write has_legitimacy > 60 while expecting a low-legitimacy penalty event to fire, producing the exact opposite result — and a bug that is surprisingly hard to track down.