The EquipmentPrototype page shows energy_source specifically as ElectricEnergySource rather than a generic EnergySource.
Some mods, e.g. Jetpack successfully use a battery equipment with an energy_source of type = "void".
There are many other places where energy_source is set to specific sources. Worth looking over those as well.
EquipmentPrototype states energy_source as ElectricEnergySource but it can be different - No, just confusing
Re: EquipmentPrototype states energy_source as ElectricEnergySource but it can be different
It's getting loaded as an electric energy source. When the energy source is directly loaded as one of the subtypes (NOT via EnergySource or another union type), the "type" is ignored, regardless of whether it is correct or incorrect.
I'll consider this post an indication to improve https://lua-api.factorio.com/latest/typ ... .html#type to mention that not only it's not mandatory, is completely ignored when the energy source is loaded directly as a ElectricEnergySource.
See also viewtopic.php?p=595871#p595871.
I'll consider this post an indication to improve https://lua-api.factorio.com/latest/typ ... .html#type to mention that not only it's not mandatory, is completely ignored when the energy source is loaded directly as a ElectricEnergySource.
See also viewtopic.php?p=595871#p595871.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: EquipmentPrototype states energy_source as ElectricEnergySource but it can be different - No, just confusing
Jetpack creates equipment specifying `energy_source.type = "void"` but game ignores this field as it is implemented to only ever load electric energy source (there is no need to specify type if there is nothing to choose from). This is why jetpack also specifies `usage_priority` as otherwise the electric energy source would not load. You can verify that jetpack has electric energy source by opening Prototype Explorer GUI (Ctrl+Shift+E) and in equipment search for jetpack: energy source prototype is marked as type `unique_ptr<ElectricEnergySourcePrototype>`, it literally does not accept any other energy source type.
Re: EquipmentPrototype states energy_source as ElectricEnergySource but it can be different - No, just confusing
Done for the next version for BurnerEnergySource and ElectricEnergySource.Bilka wrote: ↑Tue Nov 21, 2023 8:40 pm I'll consider this post an indication to improve https://lua-api.factorio.com/latest/typ ... .html#type to mention that not only it's not mandatory, is completely ignored when the energy source is loaded directly as a ElectricEnergySource.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.