Wiki

trigger · has_available_idea_with_traits

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if country has available 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 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

常用于情报机构、顾问系统等需要检测某国是否已解锁足够数量特定职能顾问的场景,例如判断玩家是否已有超过一名情报头目可用,从而触发特定决议或焦点的解锁条件。

# 某决议的 available 块:要求该国有至少 2 个带有 head_of_intelligence 特质的可用想法
available = {
    has_available_idea_with_traits = {
        idea = head_of_intelligence
        limit = 1
        characters = yes
        ignore = generic_head_of_intelligence
    }
}

配合关系

  • [has_allowed_idea_with_traits](/wiki/trigger/has_allowed_idea_with_traits):两者常成对使用——前者检查"被允许"的想法,本 trigger 检查"当前可用"的想法,组合起来可精确区分某顾问是理论上允许招募还是实际上当前可用。
  • [has_character](/wiki/trigger/has_character):当 characters = yes 时,本 trigger 只对角色类顾问生效,配合 has_character 可进一步确认特定角色本体是否存在于国家,避免条件判断出现逻辑死角。
  • [activate_advisor](/wiki/effect/activate_advisor):确认有可用顾问后,随即用 activate_advisor 将其激活,是"检查后执行"的标准搭配模式。
  • [amount_taken_ideas](/wiki/trigger/amount_taken_ideas):用来检查已占用的顾问槽数量,与本 trigger 联用可实现"槽位未满且有合适候选人"的复合门控逻辑。

常见坑

  1. 混淆 limit 的语义limit 表示"数量必须多于该值"(strictly greater than),而非"大于等于"。若想要至少 1 个可用顾问,应填 limit = 0,填 limit = 1 实际要求的是 2 个以上,这是最常见的数值偏差错误。
  2. 忽略 characters 字段的作用范围:不填或填 characters = no 时,trigger 会同时扫描角色型与非角色型的 idea;若你的顾问全部基于角色系统(character = { ... }),却漏写 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

Commonly used in scenarios requiring detection of whether a nation has unlocked sufficient quantities of advisors with specific traits, such as determining whether the player has more than one available intelligence chief to trigger the unlock conditions for specific decisions or focuses.

# The available block of a certain decision: requires the nation to have at least 2 available ideas with the head_of_intelligence trait
available = {
    has_available_idea_with_traits = {
        idea = head_of_intelligence
        limit = 1
        characters = yes
        ignore = generic_head_of_intelligence
    }
}

Synergy

  • [has_allowed_idea_with_traits](/wiki/trigger/has_allowed_idea_with_traits): These two are frequently used as a pair—the former checks "allowed" ideas while this trigger checks "currently available" ideas. Combined together, they enable precise distinction between whether an advisor is theoretically permitted to recruit or practically available at the moment.
  • [has_character](/wiki/trigger/has_character): When characters = yes, this trigger only applies to character-type advisors. Combined with has_character, it can further confirm whether a specific character actually exists within the nation, avoiding logical gaps in condition evaluation.
  • [activate_advisor](/wiki/effect/activate_advisor): After confirming an available advisor exists, use activate_advisor to activate it immediately—this is the standard "check-then-execute" pairing pattern.
  • [amount_taken_ideas](/wiki/trigger/amount_taken_ideas): Used to check the number of occupied advisor slots. When combined with this trigger, it enables compound gating logic such as "slots not full and suitable candidates available".

Common Pitfalls

  1. Confusing the semantics of limit: limit means "quantity must be greater than that value" (strictly greater than), not "greater than or equal to". If you want at least 1 available advisor, use limit = 0; filling limit = 1 actually requires 2 or more, which is the most frequent numerical offset error.
  2. Overlooking the scope of the characters field: When omitted or set to characters = no, the trigger will scan both character-type and non-character-type ideas simultaneously. If all your advisors are character-system-based (character = { ... }) but you forget to add characters = yes, you may inadvertently include ordinary ideas in the count, producing unexpected true values.