Wiki

effect · remove_from_tech_sharing_group

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Removes country from technology sharing group of specified name.
Example: remove_from_tech_sharing_group = commonwealth_research

实战 · 配合 · 坑

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

实战用法

当一个国家退出某个科技共享同盟(例如玩家通过国策或事件让某国脱离研究合作关系)时,使用此 effect 将该国从指定的共享组中移除。常见场景包括国家间外交决裂、内战分裂出的新势力自立门户,或某阵营瓦解时清理成员资格。

# 某国因意识形态冲突退出联邦研究共享组
country_event = {
    id = my_mod.42
    option = {
        name = my_mod.42.a
        remove_from_tech_sharing_group = commonwealth_research
        add_opinion_modifier = {
            target = ENG
            modifier = left_research_pact
        }
    }
}

配合关系

  • [add_to_tech_sharing_group](/wiki/effect/add_to_tech_sharing_group):与本命令互为逆操作,常在"加入/离开"成对的逻辑分支中同时出现,确保国家的共享组归属始终处于受控状态。
  • [has_country_flag](/wiki/trigger/has_country_flag):在执行移除前用标志位校验该国是否真的已加入过该共享组,避免对未加入的国家执行无意义甚至报错的操作。
  • [country_event](/wiki/effect/country_event):移除后立即触发一个事件通知相关国家,模拟外交通报或盟友反应,使叙事更连贯。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):常作为前提触发器,判断某个国策是否已完成,再决定是否执行移除,保证脚本逻辑链的完整性。

常见坑

  1. 组名拼写必须与 add_to_tech_sharing_group 定义时完全一致(区分大小写),哪怕一个字符不同也会静默失败——游戏不会报错,但国家依然留在原共享组中,难以排查。
  2. 对未加入该共享组的国家执行此命令不会报错,但也不会有任何效果,新手容易误以为命令生效了,建议配合 has_country_flag 或相关触发器做前置校验,确保逻辑严谨。

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

When a country leaves a tech-sharing alliance (for example, the player uses a national focus or event to sever a research cooperation relationship), use this effect to remove that country from the specified sharing group. Common scenarios include diplomatic breakdown between nations, breakaway factions from civil wars establishing independence, or cleaning up memberships when an entire faction collapses.

# A country withdraws from the commonwealth research sharing group due to ideological conflict
country_event = {
    id = my_mod.42
    option = {
        name = my_mod.42.a
        remove_from_tech_sharing_group = commonwealth_research
        add_opinion_modifier = {
            target = ENG
            modifier = left_research_pact
        }
    }
}

Synergy

  • [add_to_tech_sharing_group](/wiki/effect/add_to_tech_sharing_group): Inverse operation to this command; often appears together in paired "join/leave" logic branches to ensure a country's sharing group affiliation remains under control at all times.
  • [has_country_flag](/wiki/trigger/has_country_flag): Use flag validation before executing removal to verify that the country actually has joined the sharing group, avoiding meaningless or error-prone operations on countries that never joined.
  • [country_event](/wiki/effect/country_event): Trigger an event immediately after removal to notify relevant countries, simulating diplomatic notification or ally reactions and making the narrative more cohesive.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Often serves as a prerequisite trigger to determine whether a national focus has been completed before deciding whether to execute removal, ensuring the integrity of the script logic chain.

Common Pitfalls

  1. The group name spelling must exactly match the definition in add_to_tech_sharing_group (case-sensitive); even a single character difference will fail silently—the game won't error, but the country will remain in the original sharing group, making it hard to debug.
  2. Executing this command on a country that hasn't joined the sharing group won't cause an error, but it also won't have any effect, making newcomers mistakenly believe the command worked. It's recommended to perform prerequisite validation using has_country_flag or related triggers to ensure logical soundness.