trigger · is_advisor
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
is_advisor = yes/no - Checks if the current character is an advisor
is_advisorCHARACTERnoneis_advisor = yes/no - Checks if the current character is an advisor
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_advisor 常用于判断某个角色当前是否正担任顾问职务,适合在焦点、决议或事件中限制选项——例如"只有该角色已在顾问位置上时才能触发某个升级事件",或在 available 块中防止对未入职顾问执行后续操作。
# 事件选项:仅当该角色是顾问时,才允许提升其等级
option = {
name = my_event.1.a
trigger = {
FROM = {
is_advisor = yes
}
}
FROM = {
add_skill_level = 1
}
}
[has_advisor_role](/wiki/trigger/has_advisor_role) — 与 is_advisor 联用可同时确认角色"已上任"且"持有特定顾问类型",避免误操作其他角色。[advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired) — 在需要解雇顾问前先用 is_advisor = yes 确认在职,再用此 trigger 检查是否允许解雇,逻辑更严谨。[remove_advisor_role](/wiki/effect/remove_advisor_role) — 典型流程:先用 is_advisor = yes 作为 limit,再执行移除顾问角色,防止对非顾问角色调用该 effect 产生报错或静默失败。[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor) — 两者含义相近但语义层面略有侧重,配合使用可做双重校验,区分"角色本身是顾问身份"与"角色当前被雇佣为顾问"的细微差别。is_advisor 必须在 CHARACTER scope 下使用,新手有时直接写在国家 scope 里(如 country_event 根层级),导致 trigger 始终返回假且不报错,排查困难;应先用 characters 迭代或 FROM/PREV 正确切入角色 scope。is_hired_as_advisor 混淆:is_advisor 检查的是角色"是否具有顾问身份(角色定义层面)",而非实时雇佣状态;若目标是判断该角色当前是否已被某国雇用上岗,应使用 [is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor),否则逻辑判断会出现偏差。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.
is_advisor is commonly used to check whether a character is currently serving in an advisor position. It's useful for restricting options in focuses, decisions, or events—for example, "allow this upgrade event only if the character is already in an advisor slot," or in an available block to prevent operations on non-advisor characters.
# Event option: only allow promoting the character's skill level if they are an advisor
option = {
name = my_event.1.a
trigger = {
FROM = {
is_advisor = yes
}
}
FROM = {
add_skill_level = 1
}
}
[has_advisor_role](/wiki/trigger/has_advisor_role) — Use together with is_advisor to simultaneously confirm that the character is "in office" and "holds a specific advisor type," preventing accidental operations on other characters.[advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired) — Before removing an advisor, first use is_advisor = yes to confirm they are employed, then use this trigger to check if removal is allowed for more robust logic.[remove_advisor_role](/wiki/effect/remove_advisor_role) — Typical workflow: use is_advisor = yes as a limit first, then execute the removal effect, preventing errors or silent failures when called on non-advisor characters.[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor) — While semantically similar, using both provides dual validation to distinguish between "character has advisor status" and "character is currently employed as an advisor," capturing the subtle semantic difference.is_advisor must be used within CHARACTER scope. Beginners sometimes write it directly in country scope (such as at the root level of country_event), causing the trigger to always return false without error messages and making debugging difficult. Always use characters iteration or correctly switch scopes via FROM/PREV to enter character scope first.is_hired_as_advisor: is_advisor checks whether a character "has advisor status at the character definition level," not their real-time employment state. If the goal is to check whether the character is currently hired by a specific country, use [is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor) instead, otherwise your logic will be off.