Hands-On Usage
set_sub_doctrine is commonly used in national focuses, decisions, or events to automatically unlock and equip specific sub-doctrines for player or AI nations, eliminating the need for manual selection in the interface. For example, in a "Blitzkrieg Reform" focus, upon completion the German nation is directly granted the mobile infantry sub-doctrine:
focus = {
id = GER_blitzkrieg_reform
...
completion_reward = {
GER = {
set_sub_doctrine = mobile_infantry
}
}
}
If the same track appears multiple times across different folders, you must use the extended syntax and specify both folder and track to prevent the system from assigning to the wrong slot.
Synergy
[has_completed_subdoctrine](/wiki/trigger/has_completed_subdoctrine): Check whether the target sub-doctrine is already active before using set_sub_doctrine to avoid duplicate assignment or for conditional branching logic.
[has_any_grand_doctrine](/wiki/trigger/has_any_grand_doctrine): Confirm the nation already possesses the corresponding grand doctrine system before allocating sub-doctrines, preventing silent script failures due to the doctrine system not being unlocked.
[has_completed_track](/wiki/trigger/has_completed_track): Used to detect whether a specific track has been completed, combined with logical conditions to determine which sub-doctrine path to grant.
[add_doctrine_cost_reduction](/wiki/effect/add_doctrine_cost_reduction): Commonly combined in the same focus or event—reduce doctrine research costs first, then directly unlock the sub-doctrine, forming a complete military reform reward package.
Common Pitfalls
- Forgetting that track indexing starts at 0: The
track field number is a global sequential index of all tracks within the folder (starting from 0), not merely the track number matching that specific sub-doctrine type. If a folder contains four tracks—"Infantry–Armor–Armor–Warfare"—and you want to target the second Armor track, you must write track = 2 not track = 1, otherwise the assignment will go to the wrong slot.
- Simple syntax behavior becomes unpredictable in multi-folder/multi-track scenarios: When writing
set_sub_doctrine = mobile_infantry directly, the game automatically matches the first qualifying track. If the same sub-doctrine appears in multiple places in the mod, it is very easy to assign to an unintended location. In such cases, you must switch to extended syntax and explicitly specify both folder and track.