Page 1 of 1

Got a little confused with "electric-energy-interface"

Posted: Tue Mar 12, 2024 8:27 am
by Byzzee
Hello there,

I'am making a Factorio mod, that adds some ecology stuff including wind turbines and air filtering entities and got some problems here:
  • As you can see on my screenshots, air purifier has "Consumes electricity" description segment, but wind turbine doesn't. How's that working and how may I fix it?
  • In its current state wind turbine at least produces electricity, on the other hand air purifier doesn't consume electricity at all. I'am pretty sure this is related with "No power" state, but I have no clue how to fix it.
I chose "electric-energy-interface" as my enity type especially because it doesn't recuire any input/output item - my idea was it just consumes energy and decreases pollution in the certain area.

There's my code for wind turbine:

Code: Select all

local windTurbine = {
    name = "wind-turbine",
    type = "electric-energy-interface",
    ...
    energy_source = {
        type = "electric",
	usage_priority = "primary-output",
	buffer_capacity = "30kJ",
	output_flow_limit = "30kW",
        input_flow_limit = "0W",
        render_no_power_icon = false,
    },
    energy_production = "30kW",
    energy_usage = "0kW",
    ...
}
And for air purifier:

Code: Select all

local airPurifier = {
    name = "air-purifier",
    type = "electric-energy-interface",
    ...
    energy_source = {
        type = "electric",
        usage_priority = "secondary-input",
        buffer_capacity = "0J",
	output_flow_limit = "0W",
        input_flow_limit = "100kW",
        render_no_power_icon = false,
        -- emissions_per_minute = -5
    },
    energy_production = "0kW",
    energy_usage = "100kW",
    ...
}
Screenshots: https://imgur.com/a/v6EAjn5

Re: Got a little confused with "electric-energy-interface"

Posted: Tue Mar 12, 2024 11:01 am
by FuryoftheStars
There exist mods for both that you can look at to see how they solved them.

For wind, keep in mind that wind speed can be changed at run time for variable wind speeds by mods.

For the air purifier, I believe the way other mods handle this is by making it an assembler, then have it "use" clean air filters for input and after a time, outputs dirty air filters (and in one case I believe they use fluids, too), with a negative emissions per second while running.

Re: Got a little confused with "electric-energy-interface"

Posted: Tue Mar 12, 2024 1:42 pm
by Byzzee
First of all, thank you for your reply,
FuryoftheStars wrote: Tue Mar 12, 2024 11:01 am There exist mods for both that you can look at to see how they solved them.
Yeah, I’ve checked some similar mods.
Talking about turbines, I’ve tried about 3-4 different mods and no one solved this problem, which I find pretty strange.
What about air purifier, I saw these mods there machines work like assemblers processing clean filters into dirty ones, but like I stated in my post, I’d like to avoid any “consumables” like filters etc. Just connect to electric network and you’re good to go.