Hands-On Usage
When your mod needs to reward or penalize players for changing equipment design teams through an event or national focus, you can invoke this effect within the MIO scope to directly override the base cost value. For example, after a technology breakthrough event triggers, reset the XP cost for changing design teams to a lower fixed value:
mio:my_advanced_mio = {
set_mio_design_team_change_cost = 2
}
You can also combine it with variable assignment to implement elastic costs that scale with game progression:
mio:my_advanced_mio = {
set_mio_design_team_change_cost = var:design_team_cost_var
}
Synergy
[add_mio_design_team_change_cost](/wiki/effect/add_mio_design_team_change_cost): This command performs addition/subtraction on the existing base value, whereas this command directly overwrites it; use them together by first establishing a baseline with set_, then making fine adjustments with add_.
[set_mio_design_team_assign_cost](/wiki/effect/set_mio_design_team_assign_cost): Also an MIO cost management command; typically both assignment and change costs are adjusted together in the same event or effect block to maintain consistency in game experience.
[has_mio_size](/wiki/trigger/has_mio_size): Commonly used as a prerequisite condition to check MIO scale and determine whether to apply cost overrides, such as only MIOs meeting a certain threshold receive the lower change cost.
[is_mio_available](/wiki/trigger/is_mio_available): Check if the MIO is currently available before executing cost modifications to avoid performing invalid operations on inactive MIOs.
Common Pitfalls
- Passing negative values causes errors: The official specification explicitly prohibits negative input values. Newcomers often attempt to use negative values to make design team changes "free", which results in script errors or engine rejection; to reduce costs, set the value to
0 rather than a negative number.
- Confusing the semantics of set and add:
set_mio_design_team_change_cost directly overwrites the base value, and subsequent modifiers will still stack on top of the new base value. If mistakenly used as "reduce from the current value", use add_mio_design_team_change_cost instead and pass a negative number (provided the result is non-negative).