Wiki

effect · set_faction_research_unlocked

Definition

  • Supported scope:any
  • Supported target:none

Description

Sets wheter the current countries faction can make changes to the faction research section

### Examples

TAG = { set_faction_research_unlocked = yes }

实战 · 配合 · 坑

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

实战用法

在涉及派系系统改造的 mod 中,当你希望允许某个国家的派系领袖(或成员)能够自由修改派系研究分配时,可以用此 effect 动态开启该权限。典型场景是:在特定国策或事件触发后,才解锁派系研究调整能力,而不是一开始就开放给所有人。

# 某国完成特定国策后,允许其派系开启研究协作调整
focus = {
    id = POL_alliance_research
    ...
    completion_reward = {
        POL = {
            set_faction_research_unlocked = yes
        }
    }
}

配合关系

  • [set_faction_military_unlocked](/wiki/effect/set_faction_military_unlocked):与本命令同为派系权限开关,通常成对使用,同时控制派系研究与军事两个模块的可操作性,逻辑上应保持一致。
  • [hidden_effect](/wiki/effect/hidden_effect):将本命令包裹在 hidden_effect 块中,可避免在事件或国策界面显示多余的效果提示,保持 UI 整洁。
  • [if](/wiki/effect/if):配合 if 条件判断,可以根据当前派系是否存在、国家是否为派系领袖等情况有条件地执行,防止在无派系时触发产生异常。
  • [has_game_rule](/wiki/trigger/has_game_rule):在 trigger 层面先检测相关游戏规则,再决定是否调用本 effect,适合需要根据房规动态决定是否开放派系研究的 mod。

常见坑

  1. 在无派系国家上调用:如果目标国家当前不属于任何派系,执行此 effect 不会报错但也不会产生任何实际效果,新手容易误以为已经生效,建议先用条件判断确认该国处于派系中再调用。
  2. 误解 scope 含义:该 effect 作用于当前 country 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

In mods that involve overhauling the faction system, when you want to allow a faction leader (or member) of a particular nation to freely modify faction research allocation, you can use this effect to dynamically enable that permission. A typical scenario is unlocking faction research adjustment capability only after a specific focus is completed or event is triggered, rather than granting it to everyone from the start.

# After a nation completes a specific focus, allow its faction to enable research collaboration adjustments
focus = {
    id = POL_alliance_research
    ...
    completion_reward = {
        POL = {
            set_faction_research_unlocked = yes
        }
    }
}

Synergy

  • [set_faction_military_unlocked](/wiki/effect/set_faction_military_unlocked): Serves as a faction permission switch alongside this command, typically used in pairs to simultaneously control the operability of both faction research and military modules, with logic that should remain consistent.
  • [hidden_effect](/wiki/effect/hidden_effect): Wrapping this command within a hidden_effect block avoids displaying redundant effect notifications in the event or focus interface, keeping the UI clean.
  • [if](/wiki/effect/if): When combined with if conditional checks, you can conditionally execute based on whether the faction currently exists, whether the nation is the faction leader, etc., preventing exceptions from being triggered when there is no faction.
  • [has_game_rule](/wiki/trigger/has_game_rule): Check relevant game rules at the trigger level before deciding whether to invoke this effect, suitable for mods that need to dynamically decide whether to unlock faction research based on house rules.

Common Pitfalls

  1. Calling on nations without a faction: If the target nation does not currently belong to any faction, executing this effect will not produce an error but will also have no actual effect. Beginners often mistakenly believe it has taken effect; it is recommended to use conditional checks first to confirm the nation is in a faction before calling.
  2. Misunderstanding scope semantics: This effect applies to the entire faction that the current country scope belongs to, not just that single nation in isolation. If you only want to affect a single member nation without impacting the entire faction, you need to reassess your design approach, as this command has no parameter option for "affecting only a single member."