Hands-On Usage
In a mod, if you've added a custom "military research" panel for a faction, you can use this effect to unlock the corresponding permissions after a specific event or decision triggers. For example, you might allow players to modify faction research settings only after their nation completes a certain focus. Below is a typical scenario triggered by focus completion:
focus = {
id = MY_FOCUS_UNLOCK_FACTION_RESEARCH
...
completion_reward = {
set_faction_military_unlocked = yes
}
}
Synergy
[set_faction_research_unlocked](/wiki/effect/set_faction_research_unlocked): Highly related in functionality; typically invoked together to ensure the faction research panel's display and edit permissions are unlocked simultaneously.
[hidden_effect](/wiki/effect/hidden_effect): Wrap this effect in a hidden block to prevent players from seeing meaningless unlock notification text in event options.
[custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Used in conjunction with hidden_effect to replace the default effect description with custom text, clearly communicating to players that "faction research permissions have been unlocked."
[has_game_rule](/wiki/trigger/has_game_rule): Check the current game rule before executing the unlock to ensure this effect only triggers under specific rule modes, preventing balance disruption.
Common Pitfalls
- Incorrect Scope Usage: This effect must be called within a country scope. If mistakenly written in a state or province scope or other execution blocks, it will cause script errors or silent failure. Always verify the outer scope is the target country tag.
- Unlocking Without Verifying Faction Membership: Calling this effect directly on a nation that doesn't belong to any faction may result in ineffective or undefined behavior. It's recommended to confirm via relevant triggers that the nation actually exists and belongs to a faction before invoking this effect.