effect · give_guarantee
Definition
- Supported scope:
COUNTRY - Supported target:
THIS,ROOT,PREV,FROM,OWNER,CONTROLLER,OCCUPIED,CAPITAL
Description
guarantees specified country
give_guaranteeCOUNTRYTHIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITALguarantees specified country
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
give_guarantee 常用于外交剧本事件、国策完成效果或战后和平谈判脚本中,让一国自动对另一国建立保证关系,模拟大国庇护或盟约义务。例如在国策完成后让玩家国家保证一个小国独立:
focus = {
id = guarantee_small_ally
...
completion_reward = {
# 当前 scope 为执行该国策的国家
GER = { # 切换到目标国的 scope
give_guarantee = ROOT # 由 GER 保证触发该国策的国家
}
# 或者反向:让 ROOT 保证 GER
# ROOT 的 scope 内:
give_guarantee = GER
}
}
注意 执行者 scope 就是发出保证的一方,目标才是被保证国,写之前务必确认当前 scope 是哪个国家。
[any_guaranteed_country](/wiki/trigger/any_guaranteed_country) — 用于在保证生效后检查某国的保证列表,可做后续触发条件判断是否已保证成功。[all_guaranteed_country](/wiki/trigger/all_guaranteed_country) — 配合遍历已保证国家,验证批量保证脚本的覆盖是否完整,常用于 AI 行为调试。[create_wargoal](/wiki/effect/create_wargoal) — 保证通常与战争目标联动:一旦被保证国遭到攻击,保证国需要有对应宣战借口,两者配合构成完整的干涉外交链。[diplomatic_relation](/wiki/effect/diplomatic_relation) — 用于在给出保证的同时建立或调整其他双边外交关系(如不侵犯条约),使外交包裹更完整。scope 写反导致保证方向颠倒:give_guarantee 的执行者(当前 scope)是发出保证的国家,目标参数才是被保证的国家。新手常把两国 scope 搞反,结果让小国去"保证"大国,不仅逻辑荒谬,在游戏里也几乎不产生任何实际效果。
对已不存在或已被吞并的国家执行:若目标国家在脚本执行时已经不存在(exists = no),give_guarantee 会静默失败但不报错,导致剧本推进却看不到任何保证关系出现。建议在执行前加 [exists](/wiki/trigger/exists) 检查,确保目标国仍在地图上。
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.
give_guarantee is commonly used in diplomatic scripted events, national focus completion effects, or post-war peace negotiation scripts to automatically establish a guarantee relationship between nations, simulating great power patronage or alliance obligations. For example, after completing a focus you might have the player nation guarantee a small nation's independence:
focus = {
id = guarantee_small_ally
...
completion_reward = {
# Current scope is the nation executing this focus
GER = { # Switch to target nation's scope
give_guarantee = ROOT # GER guarantees the nation that triggered this focus
}
# Or reversed: have ROOT guarantee GER
# Within ROOT's scope:
give_guarantee = GER
}
}
Remember that the executor's scope is the nation issuing the guarantee, and the target is the guaranteed nation. Always confirm which nation's scope you are in before writing.
[any_guaranteed_country](/wiki/trigger/any_guaranteed_country) — Used to check a nation's guarantee list after the guarantee takes effect; useful for subsequent trigger conditions to verify if a guarantee was successfully established.[all_guaranteed_country](/wiki/trigger/all_guaranteed_country) — Pairs with iteration over guaranteed nations to validate that batch guarantee scripts have complete coverage; commonly used for AI behavior debugging.[create_wargoal](/wiki/effect/create_wargoal) — Guarantees typically link with war goals: once a guaranteed nation is attacked, the guarantor needs corresponding justifications for war, and the two work together to form a complete diplomatic intervention chain.[diplomatic_relation](/wiki/effect/diplomatic_relation) — Used to establish or adjust other bilateral diplomatic relationships (such as non-aggression pacts) alongside issuing a guarantee, making the diplomatic package more complete.Reversed scope causing inverted guarantee direction: The executor (current scope) of give_guarantee is the nation issuing the guarantee, and the target parameter is the nation being guaranteed. Beginners often swap the two nations' scopes, resulting in a small nation "guaranteeing" a major power—not only logically absurd, but also producing almost no practical effect in-game.
Executing on nations that no longer exist or have been annexed: If the target nation no longer exists when the script executes (exists = no), give_guarantee fails silently without error messages, causing the narrative to progress while no guarantee relationship appears. It's recommended to add an [exists](/wiki/trigger/exists) check before execution to ensure the target nation is still on the map.