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
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:
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.
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})
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.