Wiki

effect · set_mio_funds_gain_factor

Definition

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

Description

Set the factor applied when gaining funds 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_funds_gain_factor = 0.9
  set_mio_funds_gain_factor = var:my_number_var
}

实战 · 配合 · 坑

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

实战用法

set_mio_funds_gain_factor 用于直接覆写军工组织的资金获取倍率,适合在事件、决议或国策完成后为某个 MIO 设定一个全新的基准效率值,例如给玩家奖励的专属军工厂设置更高的资金积累速率,或在惩罚性事件中将其压低。注意它设置的是基础值,后续来自 modifier 的加成仍会叠加在此值之上。

# 国策完成后,为指定 MIO 设置资金获取倍率
complete_national_focus = {
    mio:my_tank_manufacturer = {
        set_mio_funds_gain_factor = 1.2
    }
}

配合关系

  • [add_mio_funds_gain_factor](/wiki/effect/add_mio_funds_gain_factor)set_ 是强制覆写基础值,add_ 是在现有基础上叠加增量;两者配合可先用 set 定基准,再用 add 做微调。
  • [set_mio_funds](/wiki/effect/set_mio_funds):直接设置当前资金存量,与本命令共同使用可在初始化 MIO 时同时确定"起始金额"与"增速倍率",避免出现倍率高但起步资金为零的尴尬情况。
  • [has_mio_size](/wiki/trigger/has_mio_size):在执行倍率调整前,先用此触发器检测 MIO 当前规模,可实现"规模越大资金获取倍率越高"的条件分支逻辑。
  • [has_mio_flag](/wiki/trigger/has_mio_flag):配合 [set_mio_flag](/wiki/effect/set_mio_flag) 做幂等保护,确保同一个倍率设定不会因事件多次触发而被反复覆盖(虽然本命令是 set 语义,防御性标记仍是好习惯)。

常见坑

  1. 误传负值导致脚本报错:官方明确说明输入值不能为负数,新手有时试图用负倍率表示"惩罚",这会直接造成脚本错误;若需要惩罚效果,应将值设为一个小于 1 的正数(如 0.5)而非负数。
  2. add_mio_funds_gain_factor 混淆导致数值异常set_ 会完全替换基础值,而非叠加;如果在同一事件里先用 add_ 积累了多次加成后又调用 set_,之前所有 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_funds_gain_factor directly overwrites a military industrial organization's funds gain factor, making it ideal for setting a new baseline efficiency value for an MIO after events, decisions, or national focus completion—for example, granting the player a premium manufacturer with accelerated fund accumulation, or penalizing an MIO by reducing its factor. Note that this command sets the base value; subsequent bonuses from modifiers still stack on top of it.

# After completing a national focus, set the funds gain factor for a specific MIO
complete_national_focus = {
    mio:my_tank_manufacturer = {
        set_mio_funds_gain_factor = 1.2
    }
}

Synergy

  • [add_mio_funds_gain_factor](/wiki/effect/add_mio_funds_gain_factor): set_ forcibly overwrites the base value, while add_ stacks increments on the existing value. Use them in tandem—set_ to establish a baseline, then add_ for fine adjustments.
  • [set_mio_funds](/wiki/effect/set_mio_funds): Directly sets current fund reserves. Use alongside this command during MIO initialization to simultaneously define both "starting capital" and "growth factor," preventing the awkward scenario of high factor but zero starting funds.
  • [has_mio_size](/wiki/trigger/has_mio_size): Before adjusting the factor, use this trigger to check the MIO's current size, enabling conditional logic such as "larger MIOs receive higher fund gain factors."
  • [has_mio_flag](/wiki/trigger/has_mio_flag): Pair with [set_mio_flag](/wiki/effect/set_mio_flag) for idempotent protection, ensuring the same factor setting doesn't get repeatedly overwritten if an event fires multiple times (defensive flagging is a good habit even for set semantics).

Common Pitfalls

  1. Passing negative values causes script errors: The official documentation explicitly states input values cannot be negative. Beginners sometimes attempt to use negative factors to represent "penalties," which directly breaks the script. For penalty effects, set the value to a positive number less than 1 (such as 0.5) rather than a negative number.
  2. Confusing with add_mio_funds_gain_factor leads to unexpected values: set_ completely replaces the base value rather than stacking on it. If you accumulate multiple bonuses using add_ in the same event and then call set_, all previous add_ effects are erased. Always choose the correct command based on your design intent.