How is LuaEntity::energy calculated? Compared to energy_usage and max_energy_usage
Posted: Thu Mar 28, 2024 1:54 pm
What is the difference between and for "normal" consumer entities? They return the same value, which is the maximum power consumption (in W) - drain and divided by 60 (result is Joules per tick).
When calling on a fully powered entity, the value * 60 is higher than the maximum power consumption. How is this calculated?
When not fully powered, the value matches the consumption in the power statistics GUI.
My goal is to retrieve a percentage of available power to that entity.
Code: Select all
LuaEntityPrototype::max_energy_usage
Code: Select all
LuaEntityPrototype::energy_usage
When calling
Code: Select all
LuaEntity::energy
When not fully powered, the value matches the consumption in the power statistics GUI.
My goal is to retrieve a percentage of available power to that entity.