Hands-On Usage
add_region_efficiency is commonly used in strategic region dynamic economy system mods, such as granting production efficiency bonuses to a nation after occupying or controlling a specific strategic region, simulating the effects of resource development or infrastructure construction. It is typically triggered within event or decision execution blocks, with a strategic region as the scope, and uses FROM to point to the beneficiary nation.
# Execute within a strategic region event
strategic_region_event = {
id = my_mod.1
hidden = yes
immediate = {
add_region_efficiency = {
target = FROM # FROM is the nation that triggered this event
}
}
}
Synergy
[hidden_trigger](/wiki/trigger/hidden_trigger): Before executing add_region_efficiency, use hidden_trigger to implicitly verify that the target nation meets conditions (such as whether it actually controls provinces within the region), preventing efficiency bonuses from being granted to unintended nations.
[meta_trigger](/wiki/trigger/meta_trigger): When dynamic trigger construction is needed (for example, determining the target nation tag based on variables), wrap the logic with meta_trigger and combine with add_region_efficiency to achieve more flexible multi-nation adaptation scenarios.
Common Pitfalls
- Scope hierarchy errors:
add_region_efficiency must be called under STRATEGIC_REGION scope. Beginners often write this command directly in nation scope or province scope, causing silent script failures or errors. Use the strategic_region = { ... } block to switch to the correct scope first.
- Target reference confusion: The
target determines which nation receives the efficiency bonus. If FROM in the current event chain is not the intended nation (for example, after nested events FROM has changed), use temporary variables or ROOT/PREV to explicitly specify the correct beneficiary.