Wiki

effect · set_sub_doctrine

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Activate (unlock and assign) the specified subdoctrine.
	By default, the subdoctrine is assigned to the first matching track that the system can find.
	However, you can also specify a specific folder and track index to assign the subdoctrine to, in case
	the same track appears in multiple folders, or multiple times in the same folder

	### Examples - SIMPLE VERSION
	```
	GER = {
		set_sub_doctrine = mobile_infantry
	}
	```
	### Examples - EXTENDED VERSION
	```
	GER = {
		set_sub_doctrine = {
			sub_doctrine = mobile_infantry
			folder = land # Optional, in case you need to specify the folder
			track = 1 # Optional, in case you need to specify the track index within the folder.
			# Note that this is the track index (starting with 0) among ALL the tracks in the folder, not just the ones that match the subdoctrine.
			# So in a case where a grand doctrine has the tracks: 'infantry - armor - armor - operations', you would use
			# track = 1 to refer to the first armor track, and track = 2 to refer to the second armor track.
		}
	}
	```

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

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

  1. 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.
  2. 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.