Page 1 of 1

Defining what entities are shown in Factoriopedia as being able to extract fluids from a specific tile

Posted: Tue Jan 14, 2025 8:55 am
by Killkrog
Hello everyone!

I have an extremely simple mod that implements a "water pump". Basically the same as the offshore pump but requires some electricity to function anywhere.

Here is the entire code:

Code: Select all

local function setup_icons(t)

	t.icons = {
		{
			icon			= data.raw["offshore-pump"]["offshore-pump"].icon,
			icon_size		= data.raw["offshore-pump"]["offshore-pump"].icon_size,
			scale			= 1.0,
			shift			= { 0, 0 }
		},
		{
			icon			= data.raw["fluid"]["water"].icon,
			icon_size		= data.raw["fluid"]["water"].icon_size,
			scale			= 0.6,
			shift			= { 12, -12 }
		}
	}

	t.icon					= nil

end

-- -----------------------------------------------------------------------------------------------------------

local entity = table.deepcopy(data.raw["offshore-pump"]["offshore-pump"])

entity.name						= "water-pump"
entity.corpse					= "water-pump-remnants"
entity.minable.result			= entity.name
entity.fast_replaceable_group	= entity.name
entity.collision_mask			= nil
entity.tile_buildability_rules	= nil
entity.fluid_box.filter			= "water"
entity.energy_source			= { type = "electric", usage_priority = "secondary-input" }
entity.energy_usage				= "20kW"

setup_icons(entity)

-- -----------------------------------------------------------------------------------------------------------

local remnants = table.deepcopy(data.raw["corpse"]["offshore-pump-remnants"])

remnants.name						= "water-pump-remnants"
remnants.localised_name				= { "remnant-name", { "entity-name.water-pump" }}

-- -----------------------------------------------------------------------------------------------------------

local item = table.deepcopy(data.raw.item["offshore-pump"])

item.name			= entity.name
item.place_result	= entity.name

setup_icons(item)

-- -----------------------------------------------------------------------------------------------------------

local recipe = table.deepcopy(data.raw.recipe["offshore-pump"])

recipe.name		= entity.name
recipe.results	= {{ type = "item", name = item.name, amount = 1 }}

table.insert(recipe.ingredients, { type = "item", name = "copper-cable", amount = 4 })

-- -----------------------------------------------------------------------------------------------------------

local technology = data.raw.technology["steam-power"]

table.insert(technology.effects, { type = "unlock-recipe", recipe = recipe.name })

-- -----------------------------------------------------------------------------------------------------------

data:extend({ entity, item, recipe, remnants})
Everything works fine. Can be placed only on solid ground, extracts water.

The thing is, when I select let's say a lava tile in Factoriopedia, it states that both the offshore-pump as well as the water-pump could be used to extract the fluid lava from this type of tile.

What would I need to do to fix this? I don't want to completely hide the water pump from the Factoriopedia, only stop it from being falsely listed as being able to extract lava from lava tiles.

Any help or pointer in the right direction is greatly appreciated.

Re: Defining what entities are shown in Factoriopedia as being able to extract fluids from a specific tile

Posted: Tue Jan 14, 2025 11:03 am
by Natha
Since the original offshore pump does not have any filters set, I'd say this behavior is hardcoded that it always outputs the one fluid it is placed next to and you can't prevent it pumping lava.

When I look at https://wiki.factorio.com/Offshore_pump, it should e.g. also display that it can extract ammoniacal solution when selecting the correspsonding tile.

Re: Defining what entities are shown in Factoriopedia as being able to extract fluids from a specific tile

Posted: Tue Jan 14, 2025 11:22 am
by Killkrog
Yeah, my water pump is displayed as being able to extract the same fluids from the same tiles as the offshore pump (water, lava, heavy oil, et cetera).
It being hardcoded could be indeed the case. If anyone knows for sure, please tell.
I guess for now the only other solution I have is to generate a completely new entity and recipe that produces water without any inputs and make the entire thing look like the off-shore pump.