safe ground or something

This is the place to request new mods or give ideas about what could be done.
Post Reply
Thedrah
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 10, 2017 7:25 pm
Contact:

safe ground or something

Post 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

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: safe ground or something

Post 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

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: safe ground or something

Post 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

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: safe ground or something

Post 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.

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: safe ground or something

Post 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!

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: safe ground or something

Post 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.

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: safe ground or something

Post 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?

Post Reply

Return to “Ideas and Requests For Mods”