Wiki

trigger · deal_completion

Definition

  • Supported scope:PURCHASE_CONTRACT
  • Supported target:none

Description

Check value of purchase contract completion. Example: deal_completition < 0.6

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

deal_completion 常用于监控军备采购合同的履行进度,例如在合同即将到期或交付不足时触发外交惩罚、取消合同等逻辑。典型场景是在 PURCHASE_CONTRACT scope 的事件或决议中,判断买方是否已收到足够比例的订购装备,从而决定是否允许续签或强制终止。

# 在采购合同 scope 内,若完成度低于 60% 则取消合同
cancel_purchase_contract = {
    limit = {
        deal_completion < 0.6
    }
}

配合关系

  • [cancel_purchase_contract](/wiki/effect/cancel_purchase_contract):当 deal_completion 检测到完成度不足时,直接取消该合同,是最直接的后续处理手段。
  • [buyer](/wiki/trigger/buyer):筛选出特定买方后再检查完成度,避免对所有合同一刀切地判断进度是否达标。
  • [seller](/wiki/trigger/seller):与 seller 联用可区分不同供应国的合同,精确控制只对某一卖方的合同执行完成度检查。
  • [contract_contains_equipment](/wiki/trigger/contract_contains_equipment):先确认合同涉及特定装备类型,再用 deal_completion 判断该类装备的交付进度,逻辑更严谨。

常见坑

  1. Scope 写错位置deal_completion 只在 PURCHASE_CONTRACT scope 下有效,若直接写在国家 scope(如 country_event 的顶层 trigger 块)中会静默失败或报错,必须先通过合同遍历命令进入正确 scope。
  2. 比较值误用整数:完成度是 0 到 1 的小数比例,新手容易误写成 deal_completion < 60 这样的整数,导致条件永远为真或永远为假,应始终使用 0.01.0 范围内的浮点数。

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

deal_completion is commonly used to monitor the fulfillment progress of arms trade contracts. Typical applications include triggering diplomatic penalties, canceling contracts, or other logic when a contract is nearing expiration or delivery is insufficient. The typical use case is within an event or decision in the PURCHASE_CONTRACT scope, where you check whether the buyer has received a sufficient percentage of ordered equipment to decide whether to allow contract renewal or force termination.

# Within a purchase contract scope, cancel the contract if completion is below 60%
cancel_purchase_contract = {
    limit = {
        deal_completion < 0.6
    }
}

Synergy

  • [cancel_purchase_contract](/wiki/effect/cancel_purchase_contract): When deal_completion detects insufficient completion, directly cancel the contract—this is the most straightforward follow-up action.
  • [buyer](/wiki/trigger/buyer): Filter for a specific buyer before checking completion, avoiding blanket progress checks across all contracts.
  • [seller](/wiki/trigger/seller): Combined with seller, allows you to distinguish contracts from different suppliers and precisely control completion checks for only a specific seller's contracts.
  • [contract_contains_equipment](/wiki/trigger/contract_contains_equipment): First confirm the contract involves a specific equipment type, then use deal_completion to check delivery progress for that equipment type, resulting in more robust logic.

Common Pitfalls

  1. Incorrect scope placement: deal_completion is only valid within the PURCHASE_CONTRACT scope. If written directly in a country scope (such as in the top-level trigger block of a country_event), it will silently fail or throw an error. You must first enter the correct scope using a contract iteration command.
  2. Comparing with integers instead of decimals: Completion is a decimal ratio from 0 to 1. Beginners often mistakenly write deal_completion < 60 with an integer, causing the condition to always be true or always false. Always use floating-point values in the 0.01.0 range.