Page 1 of 1

safe ground or something

Posted: Sat Mar 23, 2019 3:04 am
by Thedrah
is it possible to restrict biter ai to not go into certain areas no matter what? like a holy or consecrated ground kind of thing

i get overwhelmed quite easily in heavily modded games and i'm resorting to using a mod that toggles peaceful mode which gave me the idea of simply a peaceful area. like having the starting area actually keep them out. even if it was only a small area to get a base actually moving (takes a long time with omni for me)

maybe if i restart i'll resort to an 'easier start'/'skip burner step' kind of mod

Re: safe ground or something

Posted: Fri Apr 05, 2019 7:53 pm
by darkfrei
It's really easy mod. Now biters have collisions:
prototype.collision_mask: {["player-layer"] = true, ["train-layer"] = true}

So you need to add any collision mask from for example hazard concrete

Hazard concrete has only one collision_mask: {"ground-tile"}

So add to them some unused collision mask and ready!

The code:

Code: Select all

local concrete_tiles = {"hazard-concrete-left", "hazard-concrete-right", "concrete"}

local collision_layer = "layer-12"

for i, tile_name in pairs (concrete_tiles) do
  local tile = data.raw.tile[tile_name]
  if tile then
    tile.collision_mask = {"ground-tile", collision_layer}
  end
end

local units = {"small-biter", "medium-biter", "big-biter", "behemoth-biter", "small-spitter", "medium-spitter", "big-spitter", "behemoth-spitter"}

for i, unit_name in pairs (units) do
  local unit = data.raw.unit[unit_name]
  if unit then
    unit.collision_mask = {"player-layer", "train-layer", collision_layer}
  end
end
Link: https://mods.factorio.com/mod/Biter_Hates_Concrete

Re: safe ground or something

Posted: Tue Apr 09, 2019 9:15 pm
by Qon
Thedrah hasn't responded and thanked you darkfrei, and I don't actually need this mod. But I'll thank you on behalf of Thedrah and the community for a pretty cool mod anyways :3

Re: safe ground or something

Posted: Tue Apr 09, 2019 9:38 pm
by darkfrei
Qon wrote: Tue Apr 09, 2019 9:15 pm Thedrah hasn't responded and thanked you darkfrei, and I don't actually need this mod. But I'll thank you on behalf of Thedrah and the community for a pretty cool mod anyways :3
Thanks :) The mod is a little bit cheatty, but sometimes nice to have free zones.

Re: safe ground or something

Posted: Fri Sep 18, 2020 6:12 pm
by robot256
darkfrei wrote: Tue Apr 09, 2019 9:38 pm
Qon wrote: Tue Apr 09, 2019 9:15 pm Thedrah hasn't responded and thanked you darkfrei, and I don't actually need this mod. But I'll thank you on behalf of Thedrah and the community for a pretty cool mod anyways :3
Thanks :) The mod is a little bit cheatty, but sometimes nice to have free zones.
Maybe balance it by making concrete more expensive, or only apply it to refined concrete!

Re: safe ground or something

Posted: Fri Sep 18, 2020 9:30 pm
by darkfrei
robot256 wrote: Fri Sep 18, 2020 6:12 pm Maybe balance it by making concrete more expensive, or only apply it to refined concrete!
:idea: Very slow concrete for player or the same as for biters, the player cannot go there too.

Re: safe ground or something

Posted: Sat Sep 19, 2020 12:04 am
by robot256
darkfrei wrote: Fri Sep 18, 2020 9:30 pm
robot256 wrote: Fri Sep 18, 2020 6:12 pm Maybe balance it by making concrete more expensive, or only apply it to refined concrete!
:idea: Very slow concrete for player or the same as for biters, the player cannot go there too.
If neither players nor biters can go there, wouldn't that just be invincible walls?