Wiki

trigger · can_assign_supportive_scientist_to_faction

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Checks if the faction from the country in scope has a free slot for a supportive scientist for the country with the specialization type
ex:
Ger = {
	can_assign_supportive_scientist_to_faction = specialization_land
}

实战 · 配合 · 坑

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

实战用法

在涉及科学家系统的 mod 中,该 trigger 常用于限制决策或国策的可用性——只有当所在阵营的支持型科学家槽位尚有空余,且本国具备指定专精类型时,才允许玩家触发相关行动,避免无效分配。例如在一个扩展科研合作机制的 mod 中,可用它来限制"共享陆军研究"决策的 available 条件:

available = {
    can_assign_supportive_scientist_to_faction = specialization_land
    is_faction_leader = no
}

配合关系

  • [any_scientist](/wiki/trigger/any_scientist):先用此 trigger 检查本国是否存在符合条件的科学家,再搭配 can_assign_supportive_scientist_to_faction 确认槽位空余,双重把关防止无效操作。
  • [add_scientist_role](/wiki/effect/add_scientist_role):在 effect 块中为科学家添加支持型角色后,常在前置条件中用本 trigger 确认槽位充足,形成"先判断再执行"的标准流程。
  • [all_active_scientist](/wiki/trigger/all_active_scientist):与 all_active_scientist 配合可遍历当前活跃科学家,结合本 trigger 判断是否真的还有必要开放派遣入口。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常作为并列条件,要求国策完成后才解锁支持型科学家分配功能,增加解锁层次感。

常见坑

  1. 专精类型填写错误:新手容易将参数写成 landspecialization_land_doctrine 等不存在的值,正确写法是直接使用游戏内定义的专精标签(如 specialization_landspecialization_naval),填错后 trigger 会静默返回 false 而不报错,导致条件永远不成立。
  2. 忽略"阵营"前提:该 trigger 检查的是所在阵营的槽位,若当前国家不属于任何阵营(未加入或未建立阵营),trigger 同样会返回 false,需在外层先用相关条件确认国家处于某阵营中,否则单独使用会造成逻辑死角。

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

In mods involving the scientist system, this trigger is commonly used to restrict the availability of decisions or national focuses—allowing players to trigger related actions only when the faction still has available supportive scientist slots and the country possesses the specified specialization type, preventing ineffective assignments. For example, in a mod extending research cooperation mechanics, it can be used to limit the available condition of a "Share Land Research" decision:

available = {
    can_assign_supportive_scientist_to_faction = specialization_land
    is_faction_leader = no
}

Synergy

  • [any_scientist](/wiki/trigger/any_scientist): First use this trigger to check whether the country has scientists meeting the conditions, then pair it with can_assign_supportive_scientist_to_faction to confirm slot availability, providing dual validation to prevent ineffective operations.
  • [add_scientist_role](/wiki/effect/add_scientist_role): After adding a supportive scientist role to a scientist in the effect block, this trigger is commonly used in preconditions to confirm sufficient slots, forming a standard "check first, then execute" workflow.
  • [all_active_scientist](/wiki/trigger/all_active_scientist): Combined with all_active_scientist to iterate through currently active scientists, this trigger can be used to judge whether it's truly necessary to unlock the dispatch interface.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Often used as a parallel condition requiring national focus completion before unlocking supportive scientist assignment functionality, adding layers of unlock progression.

Common Pitfalls

  1. Incorrect specialization type specification: Beginners often write parameters as land or specialization_land_doctrine and other non-existent values. The correct approach is to use the game-defined specialization tags directly (such as specialization_land, specialization_naval). Writing it incorrectly causes the trigger to silently return false without error, resulting in the condition never being satisfied.
  2. Overlooking the "faction" prerequisite: This trigger checks the faction's available slots. If the current country does not belong to any faction (has not joined or established one), the trigger will similarly return false. You must first use related conditions in the outer layer to confirm the country is in a faction, otherwise using it alone creates a logical dead end.