Wiki

trigger · not_already_hired_except_as

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

not_already_hired_except_as = <slot> - For characters with several advisor roles, checks if the current character is already assigned in another advisor slot.
example: let's say a character can be a political advisor and a theorist. But they should only be hired in one role, never both at the same time.
then you may set in the advisor available trigger :
	advisor = {
		slot = political_advisor
		available = { not_already_hired_except_as = political_advisor } 
		...
	}
	advisor = {
		slot = theorist
		available = { not_already_hired_except_as = theorist } 
		...
	}

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

当一个角色被设计为可担任多个顾问职位时(例如"政治顾问"与"理论家"同时存在于同一角色定义中),使用此 trigger 可以防止玩家将同一角色同时雇用在两个槽位上。在自定义角色 mod 中,只要角色携带多个 advisor 块,就应在每个 available 里加上对应的检查。

character = {
    advisor = {
        slot = political_advisor
        available = {
            not_already_hired_except_as = political_advisor
        }
        traits = { smooth_talking_charmer }
        cost = 150
    }
    advisor = {
        slot = high_command
        available = {
            not_already_hired_except_as = high_command
        }
        traits = { army_logistics_2 }
        cost = 100
    }
}

配合关系

  • [is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor):可作为补充检查,确认角色当前是否已以某顾问身份被雇用,与 not_already_hired_except_as 形成互补的状态验证逻辑。
  • [has_advisor_role](/wiki/trigger/has_advisor_role):用于判断角色是否定义了某个顾问角色,常在 allowed 块中搭配使用,确保角色具备该职位资质后再做唯一性检查。
  • [set_can_be_fired_in_advisor_role](/wiki/effect/set_can_be_fired_in_advisor_role):在雇用逻辑触发后控制角色能否被解雇,与可用性检查配合构成完整的顾问生命周期管理。
  • [is_advisor](/wiki/trigger/is_advisor):快速判断角色当前是否处于任意顾问激活状态,可在 limit 中搭配使用,避免冗余的雇用操作。

常见坑

  1. 忘记在每个 advisor 块单独添加:新手常误以为只需写一次,实际上每个 advisor 块的 available 都必须各自填入以自身 slot 为参数的检查,遗漏任意一个都会导致该槽位失去互斥保护,角色可被重复雇用。
  2. 将参数写成其他 slot 名not_already_hired_except_as = political_advisor 中的参数必须与当前所在 advisor 块的 slot 值一致,若误写成另一个 slot 名,逻辑将反转——角色在已担任本职时反而无法再次被选中,而在担任其他职位时却可以重复雇用。

Hands-On Notes

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.

Hands-On Usage

When a character is designed to fill multiple advisor positions simultaneously (for example, both "Political Advisor" and "Theorist" exist in the same character definition), use this trigger to prevent players from hiring the same character in two slots at once. In custom character mods, whenever a character carries multiple advisor blocks, you should add the corresponding check in each available section.

character = {
    advisor = {
        slot = political_advisor
        available = {
            not_already_hired_except_as = political_advisor
        }
        traits = { smooth_talking_charmer }
        cost = 150
    }
    advisor = {
        slot = high_command
        available = {
            not_already_hired_except_as = high_command
        }
        traits = { army_logistics_2 }
        cost = 100
    }
}

Synergy

  • [is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor): Can serve as a supplementary check to confirm whether a character is currently hired in a particular advisor role, forming complementary state verification logic with not_already_hired_except_as.
  • [has_advisor_role](/wiki/trigger/has_advisor_role): Used to determine whether a character has a specific advisor role defined, commonly paired in allowed blocks to ensure the character qualifies for the position before applying uniqueness checks.
  • [set_can_be_fired_in_advisor_role](/wiki/effect/set_can_be_fired_in_advisor_role): Controls whether a character can be fired after hiring logic is triggered, working in conjunction with availability checks to form complete advisor lifecycle management.
  • [is_advisor](/wiki/trigger/is_advisor): Quickly determines whether a character is currently in any active advisor state, can be paired in limit to avoid redundant hiring operations.

Common Pitfalls

  1. Forgetting to add checks to each advisor block individually: Beginners often mistakenly assume it only needs to be written once, but in reality each advisor block's available section must independently include the check with its own slot as the parameter. Missing even one will cause that slot to lose mutual exclusion protection, allowing the character to be hired multiple times.
  2. Writing the parameter as a different slot name: The parameter in not_already_hired_except_as = political_advisor must match the slot value of the current advisor block. If you mistakenly write a different slot name, the logic inverts—the character cannot be selected again when already holding this position, but can be hired multiple times when holding other positions.