Wiki

trigger · is_character_slot

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

alias of has_advisor_role

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

is_character_slot is commonly used to check whether a specific character currently occupies a particular advisor role slot. Typical use cases include checking in decisions or events whether a character already holds a certain advisor position, which determines whether to trigger subsequent effects. Common scenarios include: character promotion logic, preventing duplicate appointments to the same advisor type, and filtering characters with specific advisor roles within limit blocks.

# Example: In an event, only allow a dialog option to trigger if the character occupies a specific advisor slot
option = {
    name = my_event.1.a
    trigger = {
        FROM = {
            is_character_slot = political_advisor
        }
    }
    # subsequent effects...
}

Synergy

  • [has_advisor_role](/wiki/trigger/has_advisor_role): is_character_slot is essentially an alias for this trigger; both are logically equivalent. Understanding the complete parameter syntax of has_advisor_role helps ensure correct usage of this trigger.
  • [is_advisor](/wiki/trigger/is_advisor): First use is_advisor to confirm the character is currently employed, then use is_character_slot to narrow down to the specific role slot, forming a hierarchical filtering approach.
  • [remove_advisor_role](/wiki/effect/remove_advisor_role): Once the condition is met (the character indeed occupies the slot), use this effect to safely remove their advisor role, avoiding invalid operations on characters who don't hold that slot.
  • [add_advisor_role](/wiki/effect/add_advisor_role): Used in conjunction for "if not yet occupying the slot, then add" mutual exclusion logic, commonly seen in mods that dynamically adjust advisor rosters.

Common Pitfalls

  1. Incorrect scope: This trigger must be called within a CHARACTER scope. Beginners often write is_character_slot = ... directly in a country scope, causing game errors or silent failures. You must first enter character scope through character references (such as country_with_original_tag or named character blocks) before using it.
  2. Confusion with is_advisor: is_advisor only checks whether a character "is currently employed as an advisor," while is_character_slot checks the specific role slot type they occupy. These have different meanings. Using only is_advisor cannot distinguish between political advisors and military advisors; always select the correct trigger based on your requirements.