Wiki

effect · create_wargoal

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

creates wargoal for country in scope

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

create_wargoal is commonly used in event-driven or decision-based scripted mods to automatically grant a nation a casus belli against a target nation upon specific conditions, eliminating the need for manual diplomatic requests through the UI. For example, in a "national revenge" event, a country can gain a declaration of war justification against another nation immediately after a treaty is broken:

country_event = {
    id = revenge.1
    # ...
    option = {
        name = revenge.1.a
        create_wargoal = {
            type = annex_everything
            target = FRA
        }
    }
}

Synergy

  • [declare_war_on](/wiki/effect/declare_war_on): create_wargoal only creates the casus belli; if your script requires immediate war declaration, chain this command right after to achieve the complete flow of "obtain justification → declare war immediately."
  • [has_annex_war_goal](/wiki/trigger/has_annex_war_goal): Checks whether a nation already possesses a specific casus belli, useful as a precondition to prevent duplicate create_wargoal calls.
  • [add_named_threat](/wiki/effect/add_named_threat): Increases world tension before war declaration; combined with casus belli creation, this ensures AI behavior aligns better with your script's narrative intent.
  • [country_event](/wiki/effect/country_event): Immediately sends a notification event to the target nation after creating the casus belli, giving them the chance to trigger diplomatic responses and enriching your event chain storytelling.

Common Pitfalls

  1. Omitting the target field: create_wargoal must explicitly specify target (the nation against which the casus belli is directed) within the block. Many beginners mistakenly assume "whoever owns the scope gets the war goal" and omit this field, resulting in script errors or effects failing to trigger.
  2. Calling under the wrong scope: This effect is only valid within COUNTRY scope. If invoked directly within STATE or CHARACTER scope without proper scope conversion (e.g., using owner), the casus belli will fail to create silently with no error message, making it extremely easy to overlook during debugging.