Hands-On Usage
This effect is commonly used in colonial empire-style mods to allow a overlord nation (such as ENG for Britain) to automatically create division templates for its dominions or colonies (such as RAJ for India) that match local aesthetics, avoiding manual operations in the subject nation interface. A typical scenario is completing a national focus or decision in the overlord nation, then batch-generating unified infantry division templates for multiple colonies.
# In the completion effect block of ENG's national focus
create_colonial_division_template = {
subject = RAJ
division_template = {
name = "Colonial Infantry"
division_names_group = RAJ_INF_01
regiments = {
infantry = { x = 0 y = 0 }
infantry = { x = 0 y = 1 }
infantry = { x = 1 y = 0 }
}
support = {
artillery = { x = 0 y = 0 }
}
}
}
Synergy
[every_subject_country](/wiki/effect/every_subject_country): Iterates through all subject nations of an overlord, combining conditional checks before invoking this effect in bulk to generate templates for each colony in one go, eliminating the need to hardcode every country tag individually.
[has_autonomy_state](/wiki/trigger/has_autonomy_state): Checks the subject's autonomy level (such as whether it is a colony or dominion) before execution, ensuring templates are only created for eligible subjects and preventing accidental triggers on independent nations.
[division_template](/wiki/effect/division_template): The division_template block syntax within this effect is nearly identical to the standalone division_template effect; mastering the latter's field rules (regiments, support, priority, etc.) is prerequisite to correctly populating the inner block.
[any_subject_country](/wiki/trigger/any_subject_country): Used at the trigger condition level to determine whether an overlord possesses a specific subject, and combined with exists to confirm the target tag exists before execution, preventing script errors and crashes.
Common Pitfalls
- Scope placed incorrectly: This effect must be executed under the country scope of the overlord nation, with the
subject parameter filled with the subject's tag; beginners often reverse this by invoking it within the subject's scope and filling subject with themselves, resulting in failed template generation or logic errors.
- Subject nation does not exist or is not a subject: If the country tag written does not yet exist in the game (
exists = no) or lacks an overlord-subject relationship with the executing nation, the effect fails silently without error reporting. Always perform prerequisite checks in the outer scope using [exists](/wiki/trigger/exists) and [has_autonomy_state](/wiki/trigger/has_autonomy_state).