Wiki

effect · every_character

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Executes children effects on every Character (or \"random_select_amount\" of random character if specified) of the country in scope, that fulfills the \"limit\" trigger.
tooltip=key can be added to override tooltip title.
By default the effects are only displayed once, you may display them for each matching character with display_individual_scopes.
ex: GER = {
  every_unit_leader = {
	tooltip = my_loc_key # Optional
	random_select_amount = 3 # Optional
	include_invisible = yes # Optional - default = no
    display_individual_scopes = yes # Optional - default = no
    ... character scope effects ...
  }
}

实战 · 配合 · 坑

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

实战用法

every_character 常用于 mod 中批量处理某国所有角色的状态,例如在国策或事件中统一给满足条件的将领加 trait、清除 flag 或调整技能。典型场景包括:游戏开始时给所有女性角色批量标记 flag,或在某一历史事件触发后给所有陆军指挥官移除特定特质。

GER = {
    every_character = {
        limit = {
            is_army_leader = yes
            has_trait = brilliant_strategist
        }
        add_trait = { token = politically_connected }
        set_character_flag = purge_processed
    }
}

配合关系

  • has_trait — 在 limit 块中筛选具有特定 trait 的角色,避免对全体角色盲目执行效果。
  • is_unit_leader — 用于 limit 中限定只对单位指挥官(而非顾问或情报人员)执行子效果。
  • add_unit_leader_trait — 配合本命令批量为符合条件的将领添加指挥官特质,是最常见的子效果之一。
  • remove_unit_leader_trait — 与 every_character 配合用于"净化"操作,批量清除某个旧版特质后再统一补加新特质。

常见坑

  1. 忘记加 limit 导致误操作全体角色every_character 默认作用于该国所有角色(包括顾问、情报人员等),不加 limit 筛选会意外改动不相关角色的数据,务必用 is_unit_leaderis_operative 等 trigger 缩小范围。
  2. 在非 COUNTRY scope 下调用:该 effect 仅在国家 scope 中有效,若在 CHARACTERSTATE scope 下直接写 every_character 会静默失效或报错,需先通过 ROOT/FROM 等回到正确的国家 scope。

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

every_character is commonly used in mods to batch-process all characters belonging to a country — for example, applying a trait to qualifying generals, clearing flags, or adjusting skills inside a focus or event. Typical scenarios include: marking all female characters with a flag at game start, or stripping a specific trait from all army commanders after a historical event fires.

GER = {
    every_character = {
        limit = {
            is_army_leader = yes
            has_trait = brilliant_strategist
        }
        add_trait = { token = politically_connected }
        set_character_flag = purge_processed
    }
}

Synergy

  • has_trait — Use inside a limit block to filter characters that have a specific trait, preventing effects from being applied blindly to every character.
  • is_unit_leader — Use inside limit to restrict execution to unit commanders only, excluding advisors and operatives.
  • add_unit_leader_trait — Pairs naturally with this command to bulk-add commander traits to all matching characters; one of the most common sub-effects used alongside it.
  • remove_unit_leader_trait — Combine with every_character for "cleanup" passes: strip an outdated trait from all matching characters before uniformly assigning a replacement.

Common Pitfalls

  1. Forgetting limit, causing unintended changes to all characters: every_character targets every character in the country by default — including advisors, operatives, and others. Omitting a limit block will silently modify unrelated characters. Always narrow the scope with triggers such as is_unit_leader or is_operative.
  2. Calling the effect outside a COUNTRY scope: This effect is only valid inside a country scope. Writing every_character directly inside a CHARACTER or STATE scope will either fail silently or produce an error. Use ROOT, FROM, or similar references to return to the correct country scope first.