effect · set_fuel
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
set fuel for country
set_fuelCOUNTRYnoneset fuel for country
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_fuel 用于在事件或决策中将某个国家的燃油储量直接设置为指定值,常见于剧情 mod 中模拟战争初期补给耗尽、或特定国策触发后紧急补充战略储备的场景。例如在一个表示"盟国紧急援助"的事件中,可立即将燃油量拉升至某一固定水平:
country_event = {
id = my_mod.10
option = {
name = my_mod.10.a
# 紧急援助,直接设置燃油至固定值
set_fuel = 1000
}
}
[add_fuel](/wiki/effect/add_fuel):两者互补,set_fuel 用于硬性设定绝对值,add_fuel 用于增减相对量;剧情中常先用 set_fuel 归零再用 add_fuel 按比例补充,或反之。[fuel_ratio](/wiki/trigger/fuel_ratio):触发条件检测当前燃油比例,配合 set_fuel 构成"若燃油低于阈值则强制补充"的逻辑闭环。[add_dynamic_modifier](/wiki/effect/add_dynamic_modifier):在设置燃油后附加动态修正器(如提升燃油上限或消耗率),使数值变化与机制联动更完整。set_fuel 仅支持 COUNTRY scope,若写在 STATE 或 CHARACTER 等作用域下脚本会静默失效甚至报错,需确认执行块的作用对象确为国家。set_fuel 接收的是绝对燃油量而非比例,新手有时误填 0.5 期望设为半满,实际只会设置极少量燃油;若需按容量比例操作,应先用 [fuel_ratio](/wiki/trigger/fuel_ratio) 或相关变量换算后再传值。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.
set_fuel is used to directly set a country's fuel stockpile to a specified value within events or decisions, commonly found in narrative mods to simulate supply depletion at war's outset or emergency strategic reserve replenishment after a specific national focus is triggered. For example, in an event representing "allied emergency aid," fuel can be immediately raised to a fixed level:
country_event = {
id = my_mod.10
option = {
name = my_mod.10.a
# Emergency aid, directly set fuel to fixed value
set_fuel = 1000
}
}
[add_fuel](/wiki/effect/add_fuel): The two complement each other; set_fuel enforces an absolute value while add_fuel adjusts relative quantities. Narrative scripts often zero out with set_fuel then replenish proportionally with add_fuel, or vice versa.[fuel_ratio](/wiki/trigger/fuel_ratio): Detects the current fuel ratio as a trigger condition, pairing with set_fuel to form a closed logic loop of "if fuel drops below threshold, force replenishment."[add_dynamic_modifier](/wiki/effect/add_dynamic_modifier): Attach dynamic modifiers after setting fuel (such as raising fuel cap or consumption rate) to create more complete integration between value changes and game mechanics.set_fuel only supports COUNTRY scope; if written under STATE or CHARACTER scopes, the script will silently fail or error. Always confirm the execution block's target is a country.set_fuel accepts absolute fuel amounts rather than ratios. Beginners sometimes mistakenly input 0.5 expecting half-full, which actually sets a negligible amount of fuel. If proportional adjustment based on capacity is needed, first use [fuel_ratio](/wiki/trigger/fuel_ratio) or related variables to convert, then pass the calculated value.