Wiki

trigger · buyer

Definition

  • Supported scope:PURCHASE_CONTRACT
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Check the buyer country. Example: buyer = GER

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

buyer is commonly used in events or decisions related to purchase contracts, checking whether the initiating party of a procurement is a specific nation, thereby implementing logic such as "only allow specific buyers to trigger subsequent effects" or "provide different responses for different buyers". For example, in an arms trading mod you can restrict a contract to only take effect when the buyer is an ally:

# In the trigger block under PURCHASE_CONTRACT scope
trigger = {
    buyer = GER
    contract_contains_equipment = { equipment = fighter_equipment_1 }
}

Synergy

  • [seller](/wiki/trigger/seller): Used together with buyer to check both parties in a transaction, useful for filtering contract relationships between specific nations, commonly seen in scenarios like "only allow weapon trades within the Axis powers".
  • [contract_contains_equipment](/wiki/trigger/contract_contains_equipment): While confirming the buyer's identity, also check the equipment types in the contract; combining these two allows precise identification of a specific deal.
  • [deal_completion](/wiki/trigger/deal_completion): After confirming the buyer, then judge whether the transaction has been completed, avoiding executing logic on ongoing contracts that should only trigger after the deal is finalized.
  • [cancel_purchase_contract](/wiki/effect/cancel_purchase_contract): When the buyer check fails (i.e., the buyer doesn't meet conditions), use this effect in combination to cancel non-compliant contracts.

Common Pitfalls

  1. Incorrect scope usage: buyer can only be called under the PURCHASE_CONTRACT scope. Beginners often mistakenly write it in a country scope (such as directly in GER = { trigger = { buyer = ... } }), causing script errors or silent failures. Always verify that the current scope has entered a purchase contract object.
  2. Confusing buyer and seller syntax: The right side of buyer takes a country tag (such as GER), not relative references like THIS/ROOT. Beginners sometimes mistakenly write buyer = THIS trying to reference the current scope, but THIS in this context actually points to the contract itself rather than a nation, so the logic won't work as intended.