Generator and water filter

Place to get help with not working mods / modding interface.
Post Reply
NindyBun
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 14, 2021 6:45 am
Contact:

Generator and water filter

Post by NindyBun »

I've set my generator to filter only water but in-game it doesn't accept it. Does that mean generator types cannot take in water as an acceptable fluid fuel?

Code: Select all

util.merge{data.raw.generator["steam-engine"],
	{
            type = "generator",
            name = "concentrating-solar-power-generator"
            minable = {hardness = 0.2, mining_time = 0.5, result = "concentrating-solar-power-generator"},
            effectivity = 1,
            fuel_usage_per_tick = 0.5,
            minimum_temperature = 15,
            fluid_box = {
                filter = "water",
            },
            max_power_output = "5.4MW"
	}
}

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2244
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Generator and water filter

Post by boskid »

What do you mean by "cannot take in water"?

If it does not produce any electricity then it is working as intended. Fluids are defined with `heat_capacity` and with `fuel_value`:
- if the generator prototype has burns_fluid="false" or is missing burns_fluid (it takes the default value of false), then the amount of energy generated is computed as

Code: Select all

AmounConsumed * (Temperature - DefaultFluidTemperature) * heat_capacity
In that case you would need to provide a water with a temperature higher than the water's default temperature.

- if the generator prototype has burns_fluid="true", amount of energy generated is computed as

Code: Select all

AmountConsumed * fuel_value
Water by default has no fuel value so it wont generate energy.

NindyBun
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 14, 2021 6:45 am
Contact:

Re: Generator and water filter

Post by NindyBun »

boskid wrote:
Wed Apr 14, 2021 7:16 am
What do you mean by "cannot take in water"?

If it does not produce any electricity then it is working as intended. Fluids are defined with `heat_capacity` and with `fuel_value`:
- if the generator prototype has burns_fluid="false" or is missing burns_fluid (it takes the default value of false), then the amount of energy generated is computed as

Code: Select all

AmounConsumed * (Temperature - DefaultFluidTemperature) * heat_capacity
In that case you would need to provide a water with a temperature higher than the water's default temperature.

- if the generator prototype has burns_fluid="true", amount of energy generated is computed as

Code: Select all

AmountConsumed * fuel_value
Water by default has no fuel value so it wont generate energy.
I had already made water's fuel_value 1.8MW but if it also needs to be higher than its default temperature of 15 celsius, then is there a way to do so, or is that simply impossible to do?

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2244
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Generator and water filter

Post by boskid »

No, its either taking energy from heat or taking energy from fuel value. If you have water with fuel value set, then you generator has to have

Code: Select all

burns_fluid = "true"
in the prototype

NindyBun
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 14, 2021 6:45 am
Contact:

Re: Generator and water filter

Post by NindyBun »

boskid wrote:
Wed Apr 14, 2021 7:43 am
No, its either taking energy from heat or taking energy from fuel value. If you have water with fuel value set, then you generator has to have

Code: Select all

burns_fluid = "true"
in the prototype
Well, at this point I made the default water temperature 100 celsius and the generator does take in the water now. However, it doesn't turn it into energy; and with

Code: Select all

burns_fluid = true
it just voids the extra water that's coming in.

Suf
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Fri Jul 10, 2020 5:07 am
Contact:

Re: Generator and water filter

Post by Suf »

NindyBun wrote:
Wed Apr 14, 2021 8:09 am
boskid wrote:
Wed Apr 14, 2021 7:43 am
No, its either taking energy from heat or taking energy from fuel value. If you have water with fuel value set, then you generator has to have

Code: Select all

burns_fluid = "true"
in the prototype
Well, at this point I made the default water temperature 100 celsius and the generator does take in the water now. However, it doesn't turn it into energy; and with

Code: Select all

burns_fluid = true
it just voids the extra water that's coming in.
Here an example how fluid is defined

Code: Select all

	
	data:extend(
{{
		type = "fluid",
		name = "name of the fluid here",
		default_temperature = 30,
		max_temperature = 40,
		--auto_barrel = true,
		base_color = {r=99, g=186, b=235},
		flow_color = {r=99, g=186, b=235},
		--gas_temperature = 25,
		icon = "put the icon location here",
		icon_size = 64,
		order = "aaa[name of fluid]"
	}}
)
As for generator

Code: Select all

data:extend(
{   
    {
        type = "generator",
        name = "put the name of generator",
        icon = "put the generator icon location here ",
        icon_size = 64, icon_mipmaps = 4,
        flags = {"placeable-neutral","player-creation"},
        minable = {mining_time = 0.3, result = "put the name of generator"},
        max_health = 400,
        dying_explosion = "medium-explosion",
        corpse = "steam-engine-remnants",
        dying_explosion = "steam-engine-explosion",
        alert_icon_shift = util.by_pixel(3, -34),
        effectivity = 0.5,
        fluid_usage_per_tick = 0.2,
        maximum_temperature = 10,
        scale_fluid_usage=true,
        resistances =
        {
          {
            type = "fire",
            percent = 70
          },
          {
            type = "impact",
            percent = 30
          }
        },
        fast_replaceable_group = "put the name of generator",
        collision_box = {{-1.0, -1.0}, {1.0, 1.0}},
        selection_box = {{-1.0, -1.0}, {1.0, 1.0}},
        --damaged_trigger_effect = hit_effects.entity(),
        fluid_box =
        {
          base_area = 10,
          height = 2,
          base_level = 10,
          pipe_covers = pipecoverspictures(),
          pipe_connections =
          {
            { type = "input", position = {0, 1.1} },
            { type = "input", position = {0, -1.1} },
            { type = "input-output", position = {3, 0} },
            { type = "input-output", position = {-3, 0} }
          },
          production_type = "input",
          filter = "put the fluid you created here",
          minimum_temperature = 1
        },
        energy_source =
        {
          type = "electric",
          usage_priority = "secondary-output",
        },
        max_power_output="100KW",--change this to redefine the power output
        horizontal_animation =
        {
          layers =
          {
            {
              filename = "put the sprite sheet location here",
              width = 250,
              height = 200,
              frame_count = 11,
              line_length = 3,
              --shift = util.by_pixel(1, -5),
              hr_version =
              {
                filename = "put the sprite sheet location here",
                width = 250,
                height = 200,
                frame_count = 11,
                line_length = 3,
                --shift = util.by_pixel(1, -4.75),
                scale = 0.5
              }
            },
            {
              filename = "put the sprite sheet shadow location here",
              width = 250,
              height = 200,
              frame_count = 11,
              line_length = 3,
              draw_as_shadow = true,
              shift={0.5, 0},
              hr_version =
              {
                filename = "put the sprite sheet shadow location here",
                width = 250,
                height = 200,
                frame_count = 11,
                line_length = 3,
                draw_as_shadow = true,
                shift={0.5, 0},
                scale = 0.5
              }
            }
          }
        },
        vertical_animation =
        {
          layers =
          {
            {
              filename = "put the sprite sheet location here",
              width = 250,
              height = 200,
              frame_count = 11,
              line_length = 3,
              --shift = util.by_pixel(5, -6.5),
              hr_version =
              {
                filename = "put the sprite sheet location here",
                width = 250,
                height = 200,
                frame_count = 11,
                line_length = 3,
                --shift = util.by_pixel(4.75, -6.25),
                scale = 0.5
              }
            },
            {
              filename = "put the sprite sheet shadow location here",
              width = 250,
              height = 200,
              frame_count = 11,
              line_length = 3,
              draw_as_shadow = true,
              shift={0.5, 0},
              hr_version =
              {
                filename = "put the sprite sheet shadow location here",
                width = 250,
                height = 200,
                frame_count = 11,
                line_length = 3,
                draw_as_shadow = true,
                shift={0.5, 0},
                scale = 0.5
              }
            }
          }
        },
        smoke =
        {
          {
           name = "light-smoke",
           north_position = {0.9, 0.0},
            east_position = {-2.0, -2.0},
            frequency = 10 / 32,
            starting_vertical_speed = 0.08,
            slow_down_factor = 1,
            starting_frame_deviation = 60
          }
        },
        --vehicle_impact_sound = sounds.generic_impact,
       -- open_sound = sounds.machine_open,
       -- close_sound = sounds.machine_close,
        working_sound =
        {
          sound =
          {
            filename = "__base__/sound/steam-engine-90bpm.ogg",
            volume = 0.55
          },
          match_speed_to_activity = true,
          audible_distance_modifier = 0.8,
          max_sounds_per_type = 3,
          fade_in_ticks = 4,
          fade_out_ticks = 20
        },
        min_perceived_performance = 0.25,
        performance_to_sound_speedup = 0.5,
        water_reflection =
        {
          pictures =
          {
            filename = "__base__/graphics/entity/steam-engine/steam-engine-reflection.png",
            priority = "extra-high",
            width = 40,
            height = 44,
            shift = util.by_pixel(0, 55),
            variation_count = 2,
            repeat_count = 2,
            scale = 5
          },
          rotate = false,
          orientation_to_variation = true
        }
      },
})
Extra Link for generator https://wiki.factorio.com/Prototype/Generator

Post Reply

Return to “Modding help”