Wiki

trigger · unit_organization

Definition

  • Supported scope:(none)
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Check scope unit organization status 0-1: Example unit_organization < 1

实战 · 配合 · 坑

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

实战用法

unit_organization 常用于判断某支部队的组织度是否处于特定阈值,适合在决策事件或 AI 行为脚本中控制"部队疲惫状态下的特殊选项"。例如,可用于限制某个决策只有在己方单位组织度接近满值时才可用,避免玩家在部队残血状态下触发激进行动。

# 示例:某决策仅在部队组织度充足时才可用
available = {
    unit_organization > 0.8
}

配合关系

由于当前白名单中无其他可交叉引用的 effect 或 trigger 命令,暂无合规的配合项可列出。

说明:本 trigger 所在 scope 下白名单为空,无法按规范格式列出交叉引用,强行编造命令名会误导开发者,故此节如实留空。

常见坑

  1. 数值范围误解:组织度的合法值域是 01(浮点数),新手容易误写成 0100 的百分比形式(如 unit_organization > 80),导致条件永远为假或永远为真。
  2. Scope 混用:该 trigger 需要在正确的单位 scope 下使用,若直接写在国家 scope 的条件块里而未切换到对应的单位 scope,脚本将报错或静默失效,调试时需注意日志中的 scope mismatch 警告。

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

unit_organization is commonly used to check whether a unit's organization level is within a specific threshold, making it suitable for controlling "special options during unit fatigue states" in decision events or AI behavior scripts. For example, it can restrict a decision to only be available when your units have organization levels close to maximum, preventing players from triggering aggressive actions when units are critically damaged.

# Example: A decision is only available when unit organization is sufficient
available = {
    unit_organization > 0.8
}

Synergy

Since there are no other effect or trigger commands in the current whitelist that can be cross-referenced, there are no compliant synergy items to list.

Note: The whitelist for the scope this trigger operates in is empty, making it impossible to list cross-references in standard format. Fabricating command names would mislead developers, so this section is intentionally left blank.

Common Pitfalls

  1. Numeric Range Misunderstanding: Organization level's valid value range is 0 to 1 (floating-point), and beginners often mistakenly write it in percentage form from 0 to 100 (such as unit_organization > 80), causing the condition to always be false or always true.
  2. Scope Mixing: This trigger must be used within the correct unit scope. If written directly in a condition block under country scope without switching to the corresponding unit scope, the script will error or silently fail. Watch for scope mismatch warnings in the debug log during troubleshooting.