I tried adding water based walls and gates but one can't walk on them because the landscape still counts as water. So this needs a terrain or tile change underneath it.
Or just the tile without the walls works too. Factorio has a tile water-shallow that the player can walk on. What it lacks is a recipe and item for it. It also collides with water-ways and ships so that has to be fixed up.
In prototypes/item.lua add:
{
type = "item",
name = "water-shallow",
icon = "__base__/graphics/terrain/water-shallow/hr-water-shallow-o.png",
icon_size = 64, icon_mipmaps = nil,
subgroup = "terrain",
order = "c[landfill]-z[shallow-water]",
stack_size = 1000,
place_as_tile =
{
result = "water-shallow",
condition_size = 1,
condition = { "ground-tile" }
}
},
-- water-shallow must not collide with water-ways
local shallow = data.raw["tile"]["water-shallow"]
shallow.collision_mask = {
"water-tile",
"item-layer",
"resource-layer",
}
And in prototypes/recipe.lua add:
{
type = "recipe",
name = "water-shallow",
energy_required = 0.5,
enabled = true,
category = "crafting",
ingredients =
{
{"stone", 2},
{"sand, 1}
},
result= "water-shallow",
result_count = 4
},
I enabled it per default for simplicity. But it could be part of the landfill research or have it's own research.
If you implement the walls/gates idea then water-shallow tiles wouldn't have an item but be placed when a wall/gate is build. The problem with gates then is that they open when a player or ship approaches. I would want them to be closed when a ship approaches (so that they block the player). The graphics should then be reversed, a closed gate looks open. But that would be something to request from factorio to support.