Detecting insufficient power

Place to get help with not working mods / modding interface.
Post Reply
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Detecting insufficient power

Post by PFQNiet »

Given an electric energy interface that consumes energy, is it sufficient to check entity.status == defines.entity_status.low_power?

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Detecting insufficient power

Post by PFQNiet »

Answering my own question here: no.

"low_power" is only triggered when power production falls below 75% of demand, so is insufficient for detecting a lack of power.

Instead, compare `energy` with `electric_buffer_size`. This ratio shows how much demand is being met.

Post Reply

Return to “Modding help”