trigger · has_character
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Returns true if scoped country has character.
Example:
has_character = GER_erwin_rommel
has_characterCOUNTRYnoneReturns true if scoped country has character.
Example:
has_character = GER_erwin_rommel
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.
has_character is commonly used in national focuses, decisions, or events to check whether a specific character still exists within that country, thereby unlocking particular story branches or preventing duplicate triggering of related effects. For example, in an alternate-history mod, players can only unlock the North Africa Offensive focus if Rommel is still in Germany:
focus = {
id = GER_north_africa_offensive
available = {
has_character = GER_erwin_rommel
}
...
}
[any_character](/wiki/trigger/any_character) — When you need to check for a class of characters (such as officers with a specific trait) rather than a specific individual, use this alongside has_character to cover both "exact matching" and "fuzzy matching" scenarios.[generate_character](/wiki/effect/generate_character) — After confirming a character does not exist (NOT = { has_character = ... }), use this effect to dynamically generate the character and avoid duplicate creation.[activate_advisor](/wiki/effect/activate_advisor) — First use has_character to confirm the character exists, then activate their advisor position to prevent script errors caused by missing characters.[has_country_leader](/wiki/trigger/has_country_leader) — Frequently paired with has_character to distinguish between "is this person in the country" and "is this person currently serving as the country's leader"—two different judgment levels.has_character can only be used under COUNTRY scope. Beginners sometimes call it within state or unit_leader scope, causing scripts to fail silently or throw errors. Always verify that the outer scope is a country scope.GER_erwin_rommel) must match exactly with the definitions in the /characters/ folder. Even a single extra underscore or incorrect capitalization will cause the condition to always return false with no error message whatsoever.