Hands-On Usage
every_purchase_contract is commonly used in military-industrial mods to batch-process all purchase contracts belonging to a country — for example, cancelling all contracts that no longer meet certain conditions when an event fires, or iterating over contracts to record data. Use limit to precisely filter by buyer country or equipment type; use random_select_amount to randomly sample a subset of contracts for processing.
GER = {
every_purchase_contract = {
limit = {
buyer = {
tag = ITA
}
}
cancel_purchase_contract = yes
}
}
Synergy
- cancel_purchase_contract: The most common pairing — cancels any contract that matches the
limit condition during iteration. This is the most essential child effect used alongside every_purchase_contract.
- buyer: Used inside a
limit block to filter contracts by the purchasing country, ensuring operations only apply to contracts belonging to a specific buyer.
- seller: The counterpart to
buyer; filters contracts by the selling country, allowing precise targeting when multiple nations have overlapping contracts.
- hidden_effect: Wraps
every_purchase_contract to suppress the auto-generated tooltip, then pairs with custom_effect_tooltip to provide a custom description, keeping the UI clean and free of redundant information.
Common Pitfalls
- Forgetting to specify the correct scope, causing contracts to be iterated from the wrong country:
every_purchase_contract operates on contracts belonging to the current scope country. If the outer scope is not the intended nation (e.g. omitting GER = { ... }), the effect may iterate over an unintended country's contracts or not execute at all. Always confirm you have entered the correct country scope before calling this effect.
- Using triggers inside
limit that do not belong to the purchase contract scope: Within a contract scope, only dedicated triggers such as buyer, seller, deal_completion, and contract_contains_equipment are valid. Writing a plain country-level trigger directly (e.g. tag = GER) will cause the condition to never match or produce an error. Instead, nest it inside the appropriate scope, e.g. buyer = { tag = GER }.