Wiki

effect · set_mio_funds

Definition

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

Description

Set the amount of funds for the military industrial organization in scope.
Input value cannot be negative.
If the new total funds go over the Size Up limit, the MIO will gain size(s).
ex:
var:my_mio_var = {
  set_mio_funds = 100
  set_mio_funds = var:my_number_var
}

实战 · 配合 · 坑

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

实战用法

set_mio_funds 适合在剧本事件或国策完成时将某个军工组织的资金重置到固定值,例如为玩家新解锁的 MIO 设置初始启动资金,或在特定条件下将资金归零作为惩罚机制。与 add_mio_funds 不同,它是绝对赋值而非增量操作,因此适合"保证资金恰好为某值"的场景。

# 在国策完成时,将指定 MIO 的资金精确设为 150
complete_national_focus = {
    var:my_arms_corp = {
        set_mio_funds = 150
    }
}

配合关系

  • [add_mio_funds](/wiki/effect/add_mio_funds) — 先用 set_mio_funds 将资金重置到基准值,再用 add_mio_funds 做动态增减,两者组合可精确控制资金区间。
  • [has_mio_size](/wiki/trigger/has_mio_size) — 在执行赋值前先检查 MIO 当前规模,避免因资金过高触发意外的连续升级,起到条件门卫作用。
  • [add_mio_size](/wiki/effect/add_mio_size) — 若需在同一事件中同时控制资金和规模,可搭配使用,确保资金与规模状态保持一致的逻辑设计。
  • [set_mio_funds_gain_factor](/wiki/effect/set_mio_funds_gain_factor) — 设置资金总量的同时调整收益倍率,能从"当前值"和"增长速率"两个维度完整配置 MIO 的经济状态。

常见坑

  1. 传入负数会静默失效或报错:官方明确说明输入值不能为负,若通过变量传入时变量值恰好为负数,赋值不会如期执行,建议在赋值前用 [has_mio_size](/wiki/trigger/has_mio_size) 等条件块或变量检查确保数值合法。
  2. 误用 set 当 add 来叠加资金set_mio_funds 是覆盖赋值,多次调用只保留最后一次的值,不会累加;若想叠加奖励应改用 [add_mio_funds](/wiki/effect/add_mio_funds),混淆两者会导致资金被意外归零或重置。

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 is well-suited for resetting a military industrial organization's funds to a fixed value in scripted events or upon focus completion—for example, setting initial startup capital for a newly unlocked MIO, or zeroing funds as a penalty mechanism under specific conditions. Unlike add_mio_funds, this performs absolute assignment rather than incremental addition, making it ideal for "ensure funds are exactly this value" scenarios.

# Upon focus completion, set the specified MIO's funds to exactly 150
complete_national_focus = {
    var:my_arms_corp = {
        set_mio_funds = 150
    }
}

Synergy

  • [add_mio_funds](/wiki/effect/add_mio_funds) — Use set_mio_funds first to reset funds to a baseline, then apply add_mio_funds for dynamic adjustments; combining both enables precise fund range control.
  • [has_mio_size](/wiki/trigger/has_mio_size) — Check the MIO's current size before assignment to avoid unintended cascading upgrades triggered by excessive funds, acting as a conditional gatekeeper.
  • [add_mio_size](/wiki/effect/add_mio_size) — When controlling both funds and size within the same event, use them together to maintain consistent logic between fund and size states.
  • [set_mio_funds_gain_factor](/wiki/effect/set_mio_funds_gain_factor) — Adjust the income multiplier while setting total funds, allowing complete configuration of the MIO's economic state from both "current value" and "growth rate" dimensions.

Common Pitfalls

  1. Passing negative numbers silently fails or throws an error: The official documentation explicitly states input values cannot be negative. If a variable passed in happens to be negative, the assignment won't execute as expected. It's recommended to validate the value before assignment using condition blocks like [has_mio_size](/wiki/trigger/has_mio_size) or variable checks to ensure legality.
  2. Mistakenly using set as add to stack funds: set_mio_funds performs overwrite assignment; multiple calls retain only the last value and do not accumulate. If you intend to stack rewards, use [add_mio_funds](/wiki/effect/add_mio_funds) instead. Confusing the two can cause funds to be unexpectedly zeroed or reset.