effect · add_max_trait
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
Adds a max assignable trait slot for a general
Example: add_max_trait = 1
add_max_traitCHARACTERnoneAdds a max assignable trait slot for a general
Example: add_max_trait = 1
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
add_max_trait 常用于为特定将领解锁额外的特质槽位,例如在完成特殊任务、国策或事件后奖励一名精英将领,使其能够装备更多特质。典型场景包括"王牌将领成长"类 mod,通过积累战功逐步扩展将领的特质上限。
# 在一个事件 option 中,奖励特定将领额外的特质槽
character_event = {
id = my_mod.10
option = {
name = my_mod.10.a
# scope 已在 FROM 或 characters 中锁定到目标 CHARACTER
add_max_trait = 1
add_skill_level = 1
}
}
[add_trait](/wiki/effect/add_trait):扩展了特质槽上限后,立即为将领附加一个新特质,两者配合才能让新槽位"有意义"地被填满。[add_skill_level](/wiki/effect/add_skill_level):通常和能力提升一同作为高级奖励发放,给人"全面成长"的设计感,避免单独提升槽位显得突兀。[can_select_trait](/wiki/trigger/can_select_trait):在给予槽位之前用于条件判断,确认该将领当前是否仍有可用特质槽,防止在逻辑上重复叠加或溢出。[has_trait](/wiki/trigger/has_trait):常作为前置条件检查,只有当将领已拥有某个特定特质时,才触发进一步的槽位扩展,实现"特质晋升链"设计。add_max_trait 只能在 CHARACTER scope 下执行,新手容易在 COUNTRY scope(如 capital_scope 或 any_country_with_original_tag)里直接调用,导致脚本报错或静默无效;务必先通过 characters = { ... } 或 = { } 将 scope 切换到具体的角色。add_trait 手动指定,否则槽位增加了却什么都没填入,产生"白加"的困惑。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.
add_max_trait is commonly used to unlock additional trait slots for specific characters, such as rewarding an elite general with expanded capacity after completing special missions, national focuses, or events. Typical use cases include "ace pilot progression" style mods, where characters gradually expand their trait slot limits by accumulating combat achievements.
# In an event option, reward a specific character with an additional trait slot
character_event = {
id = my_mod.10
option = {
name = my_mod.10.a
# scope is already locked to the target CHARACTER in FROM or characters
add_max_trait = 1
add_skill_level = 1
}
}
[add_trait](/wiki/effect/add_trait): After expanding the trait slot limit, immediately assign a new trait to the character. Using both effects together ensures the new slot is meaningfully filled.[add_skill_level](/wiki/effect/add_skill_level): Typically awarded alongside ability improvements as a high-tier reward, creating a "comprehensive growth" design feel and avoiding the awkwardness of raising slots in isolation.[can_select_trait](/wiki/trigger/can_select_trait): Used for condition checking before granting slots, confirming whether the character currently has available trait slots and preventing logical duplication or overflow.[has_trait](/wiki/trigger/has_trait): Often serves as a prerequisite check, triggering further slot expansion only when the character already possesses a specific trait, enabling "trait promotion chain" mechanics.add_max_trait only executes in CHARACTER scope. Beginners often call it directly in COUNTRY scope (such as capital_scope or any_country_with_original_tag), resulting in script errors or silent failures. Always switch scope to a specific character first using characters = { ... } or = { }.add_trait must be called separately to specify which trait fills the slot. Otherwise, the slot increases but remains empty, creating "wasted allocation" confusion.