Simple Landfill Mining deprecated

by Nauviax

Lets players mine landfill so you can fix those mistakes you make.

Tweaks
1 year, 7 months ago
1.1
9.92K
Environment

b Kills player and buildings

1 year, 10 months ago
(updated 1 year, 10 months ago)

Hey, nice mod. However, it does actually kill player and buildings when landfill is removed from under them. You need to add check_collision_with_entities = true to the water tiles. SE does this to all tiles, and you should probably do that too (or at least water tiles: water, deep water, shallow water-1, shallow water-2).
The following would be best in data-updates or data-final-fixes:

for _, tile in pairs(data.raw.tile) do
  tile.check_collision_with_entities = true
end

Also personally I'd say that it should return the landfill item back as well, but it's your mod :)

1 year, 10 months ago

Ah yup, I tested this with Space Exploration on, and only thought to test it without minutes after uploading the mod lol.
I'll add that line of code in now, it'll be nice to make it safe.
And I actually didn't realize I wasn't getting the landfill back, as you can tell I've tested this mod very well. I'll try to fix that too.

1 year, 10 months ago
(updated 1 year, 10 months ago)

No worries, to get the landfill back, you just need to add a result to the table in minable: https://wiki.factorio.com/Prototype/Tile#minable

And thanks again for the mod. I'd been thinking about making a simple alternative to Landfill Plus (which has way too many features, and doesn't use check_collision_with_entities so is much more hacky, I think it was made before check_collision_with_entities was added). I still didn't think it was possible to do it as simply as you did, so thanks for proving me wrong :D

1 year, 10 months ago

That was also my plan, Landfill Plus worked but the warnings about UPS worried me and there was a lot of options I never planned on using in it.
I've added the result line in the latest version, so it should work now.

1 year, 10 months ago

Amazing. It was the water-under-landfill-under-concrete scenario that made me think that this method wouldn't work well, because the game only stores one hidden-tile per tile, so it can't store 'under this concrete is a landfill tile, and under the landfill is a shallow-water'. So for some reason I thought that it would forget which type of water it was. From testing though, when you place the concrete on landfill, it simply replaces the landfill with concrete, so you actually get the landfill back into your inventory (so your note about item loss in the changelog is incorrect). Which is pretty great behaviour: no item loss and no forgetting which type of water was underneath the landfill. I'm very happy now :) (and I added it into my just-released X-QoL modlist)

1 year, 10 months ago

Oh that IS an interesting interaction. I've no clue how I would fix that then, but I suppose it's not really a big deal that you get the landfill back after placing tiles.
I'll update the mod page for now, won't make a mod update just to change the changelog lol.

1 year, 10 months ago

Eh, if you're only changing the changelog, you can delete and re upload the mod version. If you aren't planning on updating soon, better not to leave incorrect info in the changelog imo.

And yes, there's nothing you can do to 'fix' this interaction, outside of incredibly hacky scripting workarounds that would defeat the whole purpose of the simplicity of this mod :)

1 year, 10 months ago

Oh that worked perfectly, thanks for all the help!

New response