Wiki

trigger · has_allowed_idea_with_traits

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if country has allowed ideas with specific traits more than limit. Example: 
has_available_idea_with_traits = { 
	idea = head_of_intelligence # trait names. can be a list of traits in { } 
	limit = 1 
	characters = yes/no - only runs this trigger on characters 
	ignore = generic_head_of_intelligence # if specified, these ideas will be ignored. can be a list of ideas in { }
}

实战 · 配合 · 坑

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

实战用法

该 trigger 常用于情报机构或顾问系统相关 mod 中,判断玩家是否已经拥有足够数量的特定特质顾问,从而解锁某条国策分支或决议选项。例如在需要"至少拥有 2 名情报头目特质顾问"才能激活某秘密行动时:

available = {
    has_available_idea_with_traits = {
        idea = head_of_intelligence
        limit = 1
        characters = yes
    }
}

配合关系

  • [has_character](/wiki/trigger/has_character):先确认特定角色存在于国家,再用本 trigger 检查其特质数量,避免空引用导致的逻辑错误。
  • [amount_taken_ideas](/wiki/trigger/amount_taken_ideas):与本 trigger 联合使用,可同时限制顾问槽位总占用量与特质匹配数量,构建更精细的解锁条件。
  • [activate_advisor](/wiki/effect/activate_advisor):通过本 trigger 判断为真后,使用该 effect 激活符合条件的顾问,形成"检查→执行"的完整逻辑链。
  • [add_ideas](/wiki/effect/add_ideas):在本 trigger 满足条件后添加对应国策思潮或加成 idea,实现顾问特质达标即触发buff的设计。

常见坑

  1. limit 的含义是"多于该数量"而非"等于"limit = 1 表示需要超过 1 个满足条件的 idea,即至少 2 个才返回真,新手容易误以为等于 1 个即触发。
  2. 忘记区分 characters 字段:不填或填 no 时会同时检查普通 idea 和角色类 idea,当你只想针对角色顾问进行判断时必须显式写 characters = yes,否则可能被非角色 idea 意外满足条件。

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

This trigger is commonly used in mods related to intelligence agencies or advisor systems to determine whether the player has acquired enough advisors with specific traits, thereby unlocking certain national focus branches or decision options. For example, when a secret operation requires "at least 2 advisors with the intelligence chief trait" to be activated:

available = {
    has_available_idea_with_traits = {
        idea = head_of_intelligence
        limit = 1
        characters = yes
    }
}

Synergy

  • [has_character](/wiki/trigger/has_character): First confirm that a specific character exists in the country, then use this trigger to check their trait count, avoiding logic errors caused by null references.
  • [amount_taken_ideas](/wiki/trigger/amount_taken_ideas): When used together with this trigger, you can simultaneously constrain total advisor slot occupancy and trait matching quantity, constructing more granular unlock conditions.
  • [activate_advisor](/wiki/effect/activate_advisor): After this trigger evaluates to true, use this effect to activate advisors that meet the criteria, forming a complete "check → execute" logic chain.
  • [add_ideas](/wiki/effect/add_ideas): After this trigger's condition is satisfied, add corresponding national focus ideologies or bonus ideas, implementing a design where meeting advisor trait thresholds triggers buffs.

Common Pitfalls

  1. The limit parameter means "greater than that number," not "equal to": limit = 1 means you need more than 1 matching idea, i.e., at least 2 to return true. Beginners often mistakenly think it triggers with just 1.
  2. Forgetting to distinguish the characters field: When left unfilled or set to no, it checks both regular ideas and character-type ideas. When you only want to evaluate character advisors, you must explicitly write characters = yes, otherwise you may inadvertently satisfy the condition with non-character ideas.