effect · remove_ideas_with_trait
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
Remove all ideas with specified trait from country
remove_ideas_with_traitCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALRemove all ideas with specified trait from country
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.
remove_ideas_with_trait is commonly used in events or decisions to batch-remove a category of advisors/national spirits, such as automatically removing all spirits with specific ideology markers when a regime falls, avoiding manual enumeration with remove_ideas. In dynamic political overhaul mods, it's also frequently used to "purge" all active advisors with a particular bloc trait, accomplishing synchronized removal of multiple spirits with a single line of code.
# A country undergoes revolution, clearing all spirits with fascist_ideology trait
country_event = {
id = my_mod.42
...
option = {
name = my_mod.42.a
remove_ideas_with_trait = fascist_ideology
}
}
[add_ideas](/wiki/effect/add_ideas) — Use this command to batch-remove old spirits first, then use add_ideas to add new ones, achieving collective spirit replacement, commonly seen in government transition events.[add_popularity](/wiki/effect/add_popularity) — After removing ideology-related spirits, you typically need to adjust the popularity of that ideology in parallel to maintain logical consistency in values.[has_allowed_idea_with_traits](/wiki/trigger/has_allowed_idea_with_traits) — Serves as a precondition trigger to detect whether spirits with specific traits exist, confirming the target before executing removal to avoid meaningless calls.[remove_ideas_with_trait](/wiki/effect/remove_ideas_with_trait) used in conjunction with [has_available_idea_with_traits](/wiki/trigger/has_available_idea_with_traits) — Check whether the spirit is available within a limit block first, ensuring the removal operation has a valid target to act upon, preventing errors or silent failures.traits = { ... } field of spirit definitions. If the trait name is misspelled or never declared in the ideas file, the command executes silently without any effect, making it extremely difficult to debug.character system; if the goal is to also remove the advisor position, you must additionally use deactivate_advisor separately, otherwise the advisor remains in position but the spirit bonuses disappear, causing data inconsistency.