Wiki

effect · set_mio_research_bonus

Definition

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

Description

Set the research bonus in the military industrial organization in scope.
This changes the base value. Modifiers will still apply over it.
Input value cannot be negative.
ex:
mio:my_mio = {
  set_mio_research_bonus = 0.3
  set_research_bonus = var:my_number_var
}

实战 · 配合 · 坑

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

实战用法

set_mio_research_bonus 用于直接覆写军事工业组织(MIO)的研究加成基础值,常见于 mod 中通过事件或决议动态调整某 MIO 的科研能力,例如玩家达成特定目标后给予奖励,或在特定条件下重置其研究加成。注意它是覆写而非叠加,因此也适合用来"清除"之前通过其他途径设置的数值。

# 在一个事件选项中,将指定 MIO 的研究加成重置为 0.2
mio:my_custom_mio = {
    set_mio_research_bonus = 0.2
}

配合关系

  • [add_mio_research_bonus](/wiki/effect/add_mio_research_bonus):两者互补——set_ 用于硬性覆写基础值,add_ 用于在现有值之上叠加增量,通常先用 set_ 建立基准,再用 add_ 做细粒度调整。
  • [has_mio_size](/wiki/trigger/has_mio_size):执行覆写前常需判断 MIO 当前规模,以便按规模段设置不同的研究加成值,避免一刀切。
  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed):在条件块中检查某特质是否已完成,再决定是否触发更高的研究加成覆写,实现"里程碑奖励"逻辑。
  • [set_mio_funds](/wiki/effect/set_mio_funds):常与本命令搭配出现在同一奖励块中,同步调整资金与研究加成,构成完整的 MIO 状态重置或升级效果。

常见坑

  1. 误用负值:官方明确说明输入值不能为负数,若尝试传入负值(或指向负数的变量)会导致脚本报错或行为异常;如需"降低"研究加成,应先确认目标值为非负数,而非做减法。
  2. 混淆覆写与叠加:新手容易将 set_mio_research_bonus 当成 add_ 来用,以为可以多次调用累积效果——实际上每次调用都会直接替换基础值,前一次设置的结果会被完全覆盖,调试时需特别留意日志中的最终生效值。

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

set_mio_research_bonus is used to directly overwrite the base research bonus value of a Military Industrial Organization (MIO), commonly employed in mods to dynamically adjust an MIO's research capability through events or decisions—for example, granting rewards when players achieve specific objectives or resetting research bonuses under particular conditions. Note that this is an overwrite operation, not an accumulation, making it well-suited for "clearing" values previously set through other means.

# In an event option, reset the research bonus of a specified MIO to 0.2
mio:my_custom_mio = {
    set_mio_research_bonus = 0.2
}

Synergy

  • [add_mio_research_bonus](/wiki/effect/add_mio_research_bonus): These two complement each other—set_ is used for hard-overwriting the base value, while add_ stacks an increment on top of the existing value. Typically, set_ establishes the baseline first, then add_ performs fine-grained adjustments.
  • [has_mio_size](/wiki/trigger/has_mio_size): Before executing an overwrite, it's common to check the MIO's current size so different research bonus values can be applied based on size tiers, avoiding one-size-fits-all approaches.
  • [is_mio_trait_completed](/wiki/trigger/is_mio_trait_completed): Check within condition blocks whether a certain trait has been completed, then decide whether to trigger a higher research bonus overwrite, implementing "milestone reward" logic.
  • [set_mio_funds](/wiki/effect/set_mio_funds): Frequently appears alongside this command in the same reward block, synchronizing adjustments to both funds and research bonuses to form a complete MIO state reset or upgrade effect.

Common Pitfalls

  1. Misusing negative values: The official documentation explicitly states that input values cannot be negative; attempting to pass a negative value (or a variable pointing to a negative number) will cause script errors or abnormal behavior. To "reduce" research bonuses, ensure the target value is non-negative rather than performing subtraction.
  2. Confusing overwrite with accumulation: Newcomers often mistake set_mio_research_bonus for the add_ variant, assuming it can be called multiple times to accumulate effects—in reality, each call directly replaces the base value, completely overwriting the result of the previous setting. When debugging, pay special attention to the final effective value in the logs.