Wiki

trigger · has_faction_research_unlocked

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Whether the faction has unlocked the research

### Examples

TAG = { has_faction_research_unlocked = yes }

实战 · 配合 · 坑

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

实战用法

has_faction_research_unlocked 常用于阵营共享科技体系的 mod 中,判断某国是否已通过阵营解锁了特定研究权限,从而决定是否允许该国显示某个决议或触发特定事件。例如在自定义阵营科技树 mod 里,只有阵营内某项研究已解锁时,才对成员国开放对应的加成或奖励。

# 在决议的 available 块中:判断阵营研究已解锁才允许激活
GER = {
    available = {
        is_in_faction = yes
        has_faction_research_unlocked = yes
        has_tech_bonus = {
            uses = 1
            bonus = 0.5
            category = land_doctrine
        }
    }
}

配合关系

  • is_in_faction:通常先确认该国处于阵营内,再检查阵营研究是否已解锁,避免无阵营国家触发逻辑错误。
  • is_faction_leader:与阵营领袖身份联合判断,常见于只有领袖解锁研究后成员国才能受益的设计。
  • has_tech_bonus:与科技加成条件共用,用于判断当前研究状态与已有加成是否满足某个门槛。
  • add_tech_bonus:当阵营研究已解锁条件满足时,通过此 effect 向成员国发放具体的科技研究加成奖励。

常见坑

  1. 在无阵营国家上直接使用:若目标国当前不属于任何阵营,has_faction_research_unlocked 的行为可能不符合预期(通常返回 false),应在前置条件中先用 is_in_faction = yes 做保护性判断。
  2. is_faction_leader 混淆:该 trigger 检查的是阵营层面的研究解锁状态,而非某个国家自身的科技状态;新手容易误以为只需要阵营领袖调用,实际上任意阵营成员 scope 下均可调用,结果取决于整个阵营的解锁情况而非单国。

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

has_faction_research_unlocked is commonly used in mods that implement faction-wide technology sharing systems. It checks whether a country has unlocked a specific research permission through its faction, and is typically used to control whether a decision should be visible or whether a particular event should fire. For example, in a custom faction tech tree mod, bonuses or rewards for member nations are only made available once a specific faction research has been unlocked.

# Inside a decision's available block: only allow activation if faction research is unlocked
GER = {
    available = {
        is_in_faction = yes
        has_faction_research_unlocked = yes
        has_tech_bonus = {
            uses = 1
            bonus = 0.5
            category = land_doctrine
        }
    }
}

Synergy

  • is_in_faction: Typically used before this trigger to confirm the country is actually in a faction, preventing logic errors from firing on countries with no faction membership.
  • is_faction_leader: Combined with faction leader checks in designs where member nations only benefit after the faction leader has unlocked a given research.
  • has_tech_bonus: Used alongside tech bonus conditions to verify whether the current research state and existing bonuses meet a required threshold.
  • add_tech_bonus: When the faction research unlock condition is satisfied, this effect is used to grant specific technology research bonuses to member nations.

Common Pitfalls

  1. Using it directly on a country with no faction: If the target country does not currently belong to any faction, has_faction_research_unlocked may behave unexpectedly (typically returning false). Always guard against this by checking is_in_faction = yes as a prerequisite condition.
  2. Confusing it with is_faction_leader: This trigger checks the research unlock state at the faction level, not the tech state of any individual country. Beginners often assume it only needs to be called from the faction leader's scope, but it can actually be called from any faction member's scope — the result reflects the entire faction's unlock status, not that of a single nation.