Wiki

effect · give_resource_rights

Definition

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

Description

Gives rights to take resources from specified state.
	give_resource_rights = {
		receiver = <TAG> # accepts keyword or variable
		state = <id> # accepts keyword or variable
		resources = {<Resource Name>} # [optional] If provided, only gives rights to the prodived resources.
													If not provided gives rights to all resources in the states.
	}

实战 · 配合 · 坑

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

实战用法

give_resource_rights 常用于外交/傀儡事件场景,例如宗主国强迫附庸国签署资源协议,或大国通过事件向小国索取石油、钢铁等战略资源的开采权。下面示例演示德国通过事件获取罗马尼亚(State 76)所有资源权益:

country_event = {
    id = my_mod.1
    title = "签署资源协议"
    
    option = {
        name = "接受条件"
        # 在 GER 的 scope 下执行
        give_resource_rights = {
            receiver = GER
            state = 76
        }
    }
    option = {
        name = "仅转让石油开采权"
        give_resource_rights = {
            receiver = GER
            state = 76
            resources = { oil }
        }
    }
}

配合关系

  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier):给予资源权益后通常附带外交惩罚或奖励,用于模拟被索取方的态度变化。
  • [create_import](/wiki/effect/create_import):资源权益到位后,受益国可进一步创建进口协议,确保资源实际转化为生产输入。
  • [controls_state](/wiki/trigger/controls_state):在执行前先校验给予方实际控制该 State,避免对无实际控制权的省份发放权益造成逻辑错误。
  • [add_resource](/wiki/effect/add_resource):当目标 State 本身资源量为零时,可先用此命令注入资源,再发放权益,否则权益形同虚设。

常见坑

  1. 忽略 receiver 与当前 scope 的关系receiver 填写的是接收资源权益的国家 TAG,而 effect 本身必须在拥有或控制该 State 的国家 scope 下执行。新手常把两者写反,导致脚本静默无效或触发异常。
  2. 对未被任何国家拥有的 State 使用:若目标 State 尚无 OWNER(例如某些无主地区),脚本不会报错但权益不会生效;使用前应配合 [controls_state](/wiki/trigger/controls_state) 或检查 State 归属,确认目标 State 处于有效所有权下。

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

give_resource_rights is commonly used in diplomatic and puppet state scenarios, such as when a suzerain forces a vassal to sign resource agreements, or when major powers leverage events to extract mining rights for strategic resources like oil and steel from smaller nations. The following example demonstrates Germany obtaining all resource rights to Romania (State 76) through an event:

country_event = {
    id = my_mod.1
    title = "签署资源协议"
    
    option = {
        name = "接受条件"
        # Execute within GER scope
        give_resource_rights = {
            receiver = GER
            state = 76
        }
    }
    option = {
        name = "仅转让石油开采权"
        give_resource_rights = {
            receiver = GER
            state = 76
            resources = { oil }
        }
    }
}

Synergy

  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): Resource rights grants are typically paired with diplomatic penalties or bonuses to simulate attitude shifts from the affected party.
  • [create_import](/wiki/effect/create_import): Once resource rights are in place, the beneficiary nation can establish import agreements to ensure resources translate into actual production input.
  • [controls_state](/wiki/trigger/controls_state): Validate that the granting nation actually controls the target State before execution to prevent logic errors from granting rights to uncontrolled territories.
  • [add_resource](/wiki/effect/add_resource): If the target State has zero resources, pre-inject resources with this command before granting rights; otherwise the grant becomes meaningless.

Common Pitfalls

  1. Confusing receiver with current scope: The receiver parameter specifies the country TAG that receives the resource rights, while the effect itself must execute under the scope of the nation that owns or controls the State. Newcomers often reverse these, causing the script to silently fail or trigger errors.
  2. Using on States with no owner: If the target State has no OWNER (such as unclaimed territories), the script will not error but the rights grant will not take effect. Always validate State ownership with [controls_state](/wiki/trigger/controls_state) or similar checks before execution to ensure the target State is under valid ownership.