Hands-On Usage
ai_liberate_desire is commonly used in AI decision scripts related to liberation wars and puppet independence, to determine whether the current country has liberation intent toward a target nation, thereby deciding whether to trigger related diplomatic or war goal logic. For example, in the available block of a "liberation movement" decision, it can be used to restrict execution to only AI with sufficient liberation desire toward the target:
available = {
ai_liberate_desire = {
target = FROM
value > 50
}
}
Synergy
[has_defensive_war](/wiki/trigger/has_defensive_war): Often used together to first check whether the country is in a defensive war state, then verify liberation intent, preventing the AI from triggering liberation logic in incorrect war scenarios.
[create_wargoal](/wiki/effect/create_wargoal): When liberation intent meets conditions, use in conjunction within the effect block to have the AI create a liberation war goal against the target nation.
[any_allied_country](/wiki/trigger/any_allied_country): Used to check whether any alliance member has liberation intent toward a nation; combined with ai_liberate_desire, it enables condition checking for joint liberation.
[has_country_flag](/wiki/trigger/has_country_flag): Paired with country flag markers to ensure liberation intent trigger logic executes only once, preventing repeated activation.
Common Pitfalls
- Forgetting to specify the
target field: ai_liberate_desire must explicitly write target (such as FROM, ROOT, etc.); omitting target causes script errors or undefined behavior. Beginners often mistakenly assume it works like ordinary numeric comparisons and can omit the object.
- Using outside COUNTRY scope: This trigger only functions under country scope. If accidentally written in STATE or UNIT_LEADER scope condition blocks, the game won't report obvious errors but the condition will never evaluate correctly, making debugging quite obscure.