Hands-On Usage
strategic_state_location is commonly used in mods to dynamically create or extend strategic regions, such as when adding custom territorial divisions or adjusting campaign map logic by assigning specific provinces to a strategic location category. The typical scenario involves triggering this during game start events or after decision execution, dynamically assigning newly occupied provinces to custom strategic regions, thereby influencing AI strategic planning and resource allocation.
# Triggered in the immediate block of a country event, targeting the specified state
12 = { # STATE scope
strategic_state_location = {
my_custom_area = 1234 # Add province 1234 as the anchor point for this strategic region
}
}
Synergy
[set_state_category](/wiki/effect/set_state_category): After modifying the state's administrative tier with this command, use it in conjunction with this effect to redefine strategic location; both commands work together to completely redefine the state.
[add_building_construction](/wiki/effect/add_building_construction): After determining the strategic anchor point, schedule infrastructure construction at that location using this effect to align strategic significance with production capacity.
[has_state_flag](/wiki/trigger/has_state_flag): Use this trigger before execution to check whether the state has already been flagged, avoiding logic confusion from adding the same strategic location multiple times.
[set_state_flag](/wiki/effect/set_state_flag): Immediately flag the state after executing this command to prevent subsequent events or decisions from triggering duplicate writes.
Common Pitfalls
- Province ID must actually belong to the state: If the
province_id specified does not belong to the state in the current scope, the game will silently ignore it or produce an error. Beginners often copy scripts from other states without replacing the province ID, resulting in the effect failing to apply.
- Strategic region key name must be pre-declared in
strategic_locations: Keys like my_strategic_area are not arbitrary strings and must first be registered in the corresponding strategic_locations definition file, otherwise the mod will report an undefined error at load time and the effect will not work at all.