Allowing only biters to walk on water

Place to get help with not working mods / modding interface.
Post Reply
hyspeed
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sun Jun 05, 2016 10:18 pm
Contact:

Allowing only biters to walk on water

Post by hyspeed »

Hi,

I want to update my mod (https://mods.factorio.com/mod/CitiesOfEarth3) to allow biters & spitters to walk on water (not deep water).
I've reviewed a couple of mods that do similar (https://mods.factorio.com/mod/walkable-water) & (https://mods.factorio.com/mod/Noxys_Swimming).

I extracted this code from them and it works. But I don't want to give the player the ability, just the enemy (biter) forces.
data-updates.lua

Code: Select all

require("collision_mask")

if settings.global.coe_biters_walk_on_water.value then
  local waters = {"water", "water-green"}
  for _,water in pairs(waters) do
    -- Collision mask
    local mask = data.raw.tile[water].collision_mask
    for i=#mask,1,-1 do
      if mask[i] == "player-layer" then
        table.remove(mask, i)
      end
    end
  end
end
Is there something simple I can do here that would apply only to biters?

thanks

Post Reply

Return to “Modding help”