Wiki

trigger · is_assigned

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

is_assigned = yes/no - Checks if the current unit leader is assigned to command an army/navy

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_assigned is commonly used in dynamic character management scenarios, such as preventing players from performing certain operations (like promotions, retirement, or reassigning advisor roles) on a general when they are deployed in command, or determining in events/decisions whether a character is currently in command to branch the narrative accordingly. A typical scenario is: a character simultaneously holds an advisor role, and when commanding an army they cannot be dismissed.

# Example: Only allow dismissing the advisor role if the character is not assigned to any command position
advisor_can_be_fired = {
    limit = {
        NOT = { is_assigned = yes }
    }
}

Synergy

  • [is_leading_army](/wiki/trigger/is_leading_army): These two are frequently used in combination. is_assigned determines whether a character is bound to any command position, while is_leading_army further confirms whether they are actually commanding an army unit, forming a dual validation of coarse-grained and fine-grained checks.
  • [advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired): When protecting a general on active deployment from being dismissed from their advisor position, using is_assigned as a negated precondition for advisor_can_be_fired provides the most direct logic.
  • [retire](/wiki/effect/retire): Use is_assigned = no as a protective check before triggering the force retirement effect, preventing the logical error of losing command when retiring a general still commanding troops.
  • [is_corps_commander](/wiki/trigger/is_corps_commander): Combined use allows distinguishing between "corps commanders assigned to command" and "unassigned corps commanders", commonly found in scripts that grant different traits or experience rewards based on battlefield status.

Common Pitfalls

  1. Confusing "character ownership" with "assigned to command": Beginners often mistakenly believe that if a character has the corps_commander or field_marshal role, is_assigned will return yes. In reality, this trigger only returns true after the character is actually dragged into a command position by the player/AI (bound to a specific army/fleet). Unassigned generals return no even if they have role definitions.
  2. Misusing in Country scope: is_assigned only works in CHARACTER scope. If written directly in a country event's trigger block without first switching scope using any_character/specific character scope, the script will silently fail or throw an error, making debugging difficult.