Hands-On Usage
remove_trait is commonly used to dynamically adjust character attributes after events or decisions trigger—for example, a general loses the "brilliant_strategist" trait after a military defeat, or an advisor loses an ideology-specific trait due to political shift. In roleplay-oriented mods, it's also frequently used for trait "upgrade replacement"—remove the old trait first, then add a new one to implement a progression system.
# In a country event, a general loses a trait after defeat
country_event = {
id = my_mod.5
option = {
name = my_mod.5.a
remove_trait = {
character = GER_von_manstein
trait = brilliant_strategist
}
}
}
# When replacing a country leader's ideology trait, specify ideology
remove_trait = {
character = GER_hitler
trait = fascist_demagogue
ideology = fascism_ideology
}
Synergy
[add_trait](/wiki/effect/add_trait): The most common companion—after removing an old trait, immediately add a new one to implement trait replacement and upgrade logic.
[remove_advisor_role](/wiki/effect/remove_advisor_role): When an advisor's trait is removed, if you need to simultaneously revoke their advisor position, pair this command to ensure slot consistency.
[add_country_leader_trait](/wiki/effect/add_country_leader_trait) / [remove_country_leader_trait](/wiki/effect/remove_country_leader_trait): When handling leader-exclusive traits, these commands have clear division of labor with remove_trait—it's recommended to prioritize the dedicated commands for leader traits to avoid ambiguity.
[has_character](/wiki/trigger/has_character): Check whether the target character exists in the country before execution to prevent script errors caused by a non-existent character.
Common Pitfalls
- Forgetting to fill in the
slot or ideology field: When removing a trait from an advisor character without slot, the game won't correctly update the advisor position state; similarly, modifying a country leader's trait without ideology causes the effect to not apply—this is the most frequent omission error.
- Forgetting to specify
character under COUNTRY scope: You can only omit the character field within CHARACTER scope (such as inside an every_character loop); when writing directly in a country event option, you must explicitly specify the target character token, otherwise the command silently fails with no error message, making it difficult to debug.