trigger · has_subject
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
Checks if the country has for subject the given country
has_subjectCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALChecks if the country has for subject the given country
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_subject 常用于宗主国专属的决策或事件触发条件,例如判断某国是否已将特定国家纳入附庸体系,从而解锁后续外交链或显示特殊 UI 提示。在傀儡整合、殖民扩张或自治度机制 mod 中尤为常见。
# 仅当玩家国家以 GER 为宗主、且 GER 拥有 POL 作为附庸时,才触发该事件
country_event = {
id = my_mod.1
trigger = {
tag = GER
has_subject = POL
}
}
[has_autonomy_state](/wiki/trigger/has_autonomy_state):常与 has_subject 同时使用,在确认附庸关系存在后,进一步检查该附庸当前处于哪种自治等级,精准控制自治度升降流程。[any_subject_country](/wiki/trigger/any_subject_country):当需要检查"是否有任意附庸满足某条件"时与本 trigger 配合,has_subject 指向特定目标,any_subject_country 则做泛用扫描。[end_puppet](/wiki/effect/end_puppet):在 effect 块中作为后续动作,当 has_subject 确认附庸关系存在后,才安全调用此 effect 解除傀儡,避免脚本报错。[add_autonomy_score](/wiki/effect/add_autonomy_score):宗主国专属决策场景中,先以 has_subject 验证目标身份,再对该附庸增减自治度分数,逻辑更严谨。has_subject 要写在宗主国 scope 下,填入的目标是附庸国 tag。新手常将其误写在附庸国 scope 下,导致条件永远不满足,且不会产生明显报错。PREV/ROOT 回溯会导致指向错误的 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.
has_subject is commonly used in decision or event trigger conditions exclusive to suzerain nations, such as checking whether a specific nation has been incorporated into a subject vassal system, thereby unlocking subsequent diplomatic chains or displaying special UI prompts. It is particularly prevalent in puppet integration, colonial expansion, or autonomy mechanics mods.
# This event only triggers when the player nation has GER as suzerain and GER has POL as a subject
country_event = {
id = my_mod.1
trigger = {
tag = GER
has_subject = POL
}
}
[has_autonomy_state](/wiki/trigger/has_autonomy_state): Often used together with has_subject. After confirming a subject relationship exists, it further checks what autonomy tier the subject is currently at, enabling precise control over autonomy score increase/decrease flows.[any_subject_country](/wiki/trigger/any_subject_country): When you need to check "whether any subject satisfies a certain condition," pair it with this trigger. has_subject targets a specific nation, while any_subject_country performs a general scan.[end_puppet](/wiki/effect/end_puppet): Used as a follow-up action in effect blocks. Only after has_subject confirms a subject relationship exists should this effect be safely called to break the puppet relationship, avoiding script errors.[add_autonomy_score](/wiki/effect/add_autonomy_score): In suzerain-exclusive decision scenarios, first use has_subject to verify the target's status, then add or subtract autonomy scores for that subject, resulting in more rigorous logic.has_subject must be written in the suzerain nation scope, with the target being the vassal nation's tag. Beginners often mistakenly write it in the subject nation's scope, causing the condition to never be satisfied and producing no obvious error message.PREV/ROOT to backtrack will cause the trigger to reference the wrong scope.