Wiki

effect · set_unit_organization

Definition

  • Supported scope:(none)
  • Supported target:none

Description

set unit organization to current * value: set_unit_organization = 0.5, values between 0 and 1

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

set_unit_organization is commonly used in events or decisions to instantly adjust unit morale status after being triggered. For example, it can be used to penalize the player during a supply crisis event, or to make a specific division appear in an "exhausted" state in special storylines. It acts on the division-level unit targeted by the current scope, setting the current organization level through a multiplier ratio rather than an absolute value.

# Supply crisis event option: all active divisions' organization reduced to half
country_event = {
    id = supply_crisis.1
    option = {
        name = supply_crisis.1.a
        # Iterate through all divisions and set organization to 50% of max
        every_army_division = {
            set_unit_organization = 0.5
        }
    }
}

Synergy

Since there are currently no other similar commands in the whitelist for this effect's scope, the following are typical commands frequently paired in upper-level structures during actual development. Please verify availability according to your project's actual whitelist:

⚠️ The official scope whitelist currently provided is empty, making it impossible to list cross-references in [xxx](/wiki/effect/xxx) or [xxx](/wiki/trigger/xxx) format according to rules. Forced entries would violate the principle of "not inventing non-existent commands," so this section accurately describes this situation to avoid misleading information.

Common Pitfalls

  1. Misusing absolute values: Beginners often pass absolute organization values like 500, but this command accepts a ratio coefficient between 0 and 1 (representing a percentage of max organization). Passing values outside this range may cause anomalous behavior or be truncated directly by the engine.

  2. Incorrect scope targeting: This command must act on a division/unit scope. If written directly in a country scope or state scope without drilling down through iteration commands like every_army_division, the command will fail to identify the target, and the effect will silently fail without error messages.