Wiki

trigger · energy_ratio

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

energy_ratio > 0.8 - Compare current energy fulfilment to the factories, with 1 being 100% and 0 being 0%

实战 · 配合 · 坑

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

实战用法

energy_ratio 常用于判断某国电力/能源供应是否充足,适合在工业决策、国策完成条件或 AI 战略 mod 中作为解锁条件——例如只有当能源满足率达到一定水平时才允许扩大军工生产或触发特定事件。也可用于动态难度 mod 中,当能源严重不足时强制触发惩罚事件。

# 仅当能源供应充足时才允许触发该决策
available = {
    energy_ratio > 0.8
    num_of_factories > 20
}
# 在国家事件中,能源不足时施加惩罚想法
trigger = {
    energy_ratio < 0.5
    has_war = yes
}

配合关系

  • ic_ratio:工业产能利用率与能源满足率常同时检查,确保国家同时满足产能与能源双重门槛才触发高级工业国策。
  • has_war:战时能源紧张是典型场景,二者配合可精准筛选出"正在交战且能源短缺"的国家来触发危机事件。
  • add_ideas:当 energy_ratio 低于阈值时配合该 effect 添加"能源短缺"惩罚 idea,形成完整的条件→后果逻辑链。
  • has_stability:能源与稳定度双重不足往往意味着国家濒临崩溃,二者搭配常见于内战或崩溃触发条件中。

常见坑

  1. 阈值方向写反energy_ratio > 0.8 表示能源充足,而 energy_ratio < 0.8 表示能源不足,新手有时因语义混淆将判断方向搞反,导致条件在完全相反的情况下触发。
  2. 误以为该值会实时反映燃料(fuel)状态energy_ratio 衡量的是电力/能源对工厂的满足比例,与燃料系统(fuel)无关;若想判断燃料充足度,应使用 fuel_ratio 而非本 trigger。

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

energy_ratio is commonly used to check whether a country's power/energy supply is sufficient. It works well as an unlock condition in industrial decisions, national focus completion requirements, or AI strategy mods — for example, allowing expanded military-industrial production or triggering specific events only when the energy satisfaction rate reaches a certain level. It can also be used in dynamic difficulty mods to force penalty events when energy is critically low.

# Only allow this decision to fire when energy supply is sufficient
available = {
    energy_ratio > 0.8
    num_of_factories > 20
}
# In a country event, apply a penalty idea when energy is insufficient
trigger = {
    energy_ratio < 0.5
    has_war = yes
}

Synergy

  • ic_ratio: Industrial capacity utilization and energy satisfaction rate are often checked together, ensuring a country meets both production capacity and energy thresholds before an advanced industrial focus can fire.
  • has_war: Wartime energy shortages are a classic scenario — combining these two triggers lets you precisely target countries that are "actively at war and running low on energy" to fire crisis events.
  • add_ideas: When energy_ratio falls below a threshold, pair this with the effect to add an "energy shortage" penalty idea, forming a complete condition → consequence logic chain.
  • has_stability: A simultaneous lack of both energy and stability often signals a country on the brink of collapse; the two are frequently combined in civil war or collapse trigger conditions.

Common Pitfalls

  1. Threshold direction reversed: energy_ratio > 0.8 means energy is sufficient, while energy_ratio < 0.8 means energy is insufficient. Beginners sometimes mix up the semantics and flip the comparison direction, causing the condition to fire under exactly the opposite circumstances.
  2. Mistaking this for a fuel (fuel) check: energy_ratio measures the ratio of power/energy supply satisfying factory demand — it has nothing to do with the fuel system. If you want to check fuel sufficiency, use fuel_ratio instead of this trigger.