effect · create_import
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Creates trade between two countries
create_importCOUNTRYnoneCreates trade between two countries
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
create_import 常用于外交 mod 或经济系统 mod 中,当两国建立同盟、签订条约或完成特定国策后,自动建立贸易关系以模拟经济往来。例如,在一个国家完成某个侧重外交的国策后触发贸易协定:
focus = {
id = establish_trade_agreement
...
completion_reward = {
create_import = {
resource = oil
amount = 10
exporter = GER
}
}
}
[give_market_access](/wiki/effect/give_market_access) — 建立贸易进口前,通常需要先给予市场准入权限,否则贸易在逻辑上缺乏前提。[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — 创建贸易关系往往伴随外交好感度变化,用于模拟双边关系改善的连锁效果。[has_country_flag](/wiki/trigger/has_country_flag) — 用于检查是否已经触发过贸易协定,防止重复执行 create_import 造成数值堆叠异常。[add_resource](/wiki/effect/add_resource) — 在贸易建立的同时调整国内资源储量,配合使用可以更细致地模拟经济输入输出。create_import 只能在 COUNTRY scope 下执行,新手常将其写在 STATE scope(如 every_owned_state 的循环体内),导致脚本报错或效果静默失效,务必确认外层 scope 是国家。exporter 填写的国家在游戏当前存在检验(exists)为 false,贸易将无法创建却不会有明显报错提示,建议配合 [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.
create_import is commonly used in diplomatic mods or economic system mods to automatically establish trade relationships between two nations upon forming alliances, signing treaties, or completing specific focuses—simulating economic exchanges. For example, triggering a trade agreement after a nation completes a diplomacy-focused focus:
focus = {
id = establish_trade_agreement
...
completion_reward = {
create_import = {
resource = oil
amount = 10
exporter = GER
}
}
}
[give_market_access](/wiki/effect/give_market_access) — Before establishing a trade import, market access rights typically need to be granted first; otherwise, the trade lacks logical prerequisites.[add_opinion_modifier](/wiki/effect/add_opinion_modifier) — Creating trade relationships often accompanies changes in diplomatic favor, simulating cascading effects of improved bilateral relations.[has_country_flag](/wiki/trigger/has_country_flag) — Used to check whether a trade agreement has already been triggered, preventing duplicate create_import executions that cause numerical stacking anomalies.[add_resource](/wiki/effect/add_resource) — Adjust domestic resource reserves simultaneously with trade establishment; combined usage allows more granular simulation of economic input and output.create_import can only execute under COUNTRY scope. Beginners often place it within STATE scope (such as inside every_owned_state loops), causing script errors or silent effect failures. Always verify the outer scope is at the country level.exporter has an existence check (exists) that evaluates to false at the current game state, the trade will fail to create without obvious error messages. It is recommended to include an [exists](/wiki/trigger/exists) precondition check.