Wiki

effect · set_division_force_allow_recruiting

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Force allows division recruiting for a division template
Example: set_division_force_allow_recruiting = { division_template = <name> force_allow_recruiting = <bool (default:yes)> }

实战 · 配合 · 坑

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

实战用法

当玩家通过国策或决议解锁某支特殊部队编制时,可用此 effect 强制允许该模板的征召,常见于限制某类精锐师团只能在特定条件下建造的设计。例如,某个 mod 中玩家完成"组建近卫军"国策后才解锁近卫师的招募权限:

complete_national_focus = {
    # 在国策完成效果中
    set_division_force_allow_recruiting = {
        division_template = "近卫师"
        force_allow_recruiting = yes
    }
}

配合关系

  • [division_template](/wiki/effect/division_template):通常先用此命令定义或修改师团模板,再用 set_division_force_allow_recruiting 控制其招募开关,两者组合管理模板的完整生命周期。
  • [clear_division_template_cap](/wiki/effect/clear_division_template_cap):同为调控师团模板招募限制的命令,clear_division_template_cap 清除数量上限,而本命令控制是否允许招募,组合使用可实现精细化的解锁逻辑。
  • [complete_national_focus](/wiki/effect/complete_national_focus) / [has_completed_focus](/wiki/trigger/has_completed_focus):常以国策完成作为触发条件(trigger 检测),再在对应 effect 块中执行本命令,实现"研究/完成国策才能征召特定师团"的设计模式。
  • [add_ideas](/wiki/effect/add_ideas):当某个 idea 代表军事改革时,往往同时搭配本命令一起在同一个 option 中执行,使玩家在获得理念加成的同时解锁对应编制的招募。

常见坑

  1. division_template 字段填写的必须是已存在模板的精确名称(区分大小写和空格),如果模板尚未通过 division_template effect 创建或在 division_templates 中定义,游戏会静默失败,不会报错但效果不生效,导致难以排查。
  2. 忘记在不再需要强制允许时将 force_allow_recruiting 设回 no:如果游戏逻辑要求该模板在某条件结束后重新被封锁(例如战争结束或 idea 被移除),需要显式地再次调用本命令并传入 force_allow_recruiting = no,否则解锁状态会永久保留在存档中。

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

When players unlock a special division template through national focuses or decisions, this effect can be used to forcibly enable recruitment for that template. This is commonly found in designs that restrict elite division types to only be buildable under specific conditions. For example, in a certain mod, players can only unlock recruitment rights for Guard divisions after completing the "Establish the Guard" national focus:

complete_national_focus = {
    # Within the national focus completion effect
    set_division_force_allow_recruiting = {
        division_template = "近卫师"
        force_allow_recruiting = yes
    }
}

Synergy

  • [division_template](/wiki/effect/division_template): Typically used first to define or modify a division template, then set_division_force_allow_recruiting is used to control its recruitment toggle. Together they manage the complete lifecycle of the template.
  • [clear_division_template_cap](/wiki/effect/clear_division_template_cap): Both commands regulate division template recruitment restrictions. clear_division_template_cap removes quantity limits, while this command controls whether recruitment is allowed. Combined use enables fine-grained unlock logic.
  • [complete_national_focus](/wiki/effect/complete_national_focus) / [has_completed_focus](/wiki/trigger/has_completed_focus): Commonly uses national focus completion as a trigger condition (checked via trigger), then executes this command within the corresponding effect block. This implements the design pattern "research/complete a focus to recruit specific divisions."
  • [add_ideas](/wiki/effect/add_ideas): When an idea represents a military reform, it is often executed together with this command in the same option, allowing players to unlock recruitment for the corresponding template while receiving the idea bonus.

Common Pitfalls

  1. The division_template field must contain the exact name of an existing template (case-sensitive and space-sensitive). If the template has not been created via the division_template effect or defined in division_templates, the game will silently fail without error messages, leaving the effect ineffective and making debugging difficult.
  2. Forgetting to set force_allow_recruiting back to no when forced allowance is no longer needed: If game logic requires the template to be locked again after a condition ends (such as war conclusion or idea removal), you must explicitly call this command again with force_allow_recruiting = no. Otherwise, the unlock state will permanently persist in the save file.