effect · create_wargoal
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
creates wargoal for country in scope
create_wargoalCOUNTRYnonecreates wargoal for country in scope
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
create_wargoal 常用于事件或决策驱动的剧本 mod 中,让某国在特定条件触发后自动获得对目标国的战争目标,而无需玩家手动通过外交界面申请。例如在一个"民族复仇"事件中,让一国在条约破裂后立即对另一国产生宣战借口:
country_event = {
id = revenge.1
# ...
option = {
name = revenge.1.a
create_wargoal = {
type = annex_everything
target = FRA
}
}
}
[declare_war_on](/wiki/effect/declare_war_on):create_wargoal 仅创建战争目标,若剧本需要立即开战,可紧随其后调用该命令,实现"获得借口→立即宣战"的完整流程。[has_annex_war_goal](/wiki/trigger/has_annex_war_goal):用于检测某国是否已持有特定战争目标,可作为再次触发 create_wargoal 的前置条件判断,避免重复添加。[add_named_threat](/wiki/effect/add_named_threat):宣战前额外增加世界紧张度,配合战争目标的创建,使 AI 局势反应更符合剧本预期。[country_event](/wiki/effect/country_event):在创建战争目标后立即向目标国发送通知事件,给对方触发外交回应的机会,丰富事件链叙事。target 字段:create_wargoal 必须在块内明确指定 target(即战争目标的对象国),不少新手误以为"scope 是谁就打谁"而省略该字段,导致脚本报错或效果不生效。COUNTRY scope 下有效,若在 STATE 或 CHARACTER scope 内直接调用(忘记用 owner 等转换),战争目标将无法正常创建且不会有任何错误提示,排查时极易忽略。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.
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
}
}
}
[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.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.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.