[MOD 0.17] Landfill Everything!

Topics and discussion about specific mods
Hadramal
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Mar 09, 2019 5:11 pm
Contact:

[MOD 0.17] Landfill Everything!

Post by Hadramal »

I needed it for myself, so I went and wrote a mod for generating landfill tiles - grass-1 - exactly where there are entities in a blueprint. This means you can take an existing blueprint, click the new landfill button with it in your hand, and it will be placeable on water. You need to force it with shift-click and after the bots have finished landfilling you need to place it your blueprint again to get your entities. This is just the way blueprinting with landfill tiles work.

Here's a screenshot of my bots in action putting down the exact amount of landfill needed for a 480 MW reactor: https://imgur.com/cXi1B7w

The mod can be found here: https://mods.factorio.com/mod/LandfillEverything

As this is my first mod (and first bits of lua code) I'm very eager for feedback on this. I hope someone else finds it as useful as I have.

I put together a description as well, I'll repeat that here:
As 0.17 brings us the possibility for landfill in blueprints, I set out to solve the remaining issue - how to get that landfill into your existing blueprints?

I made a small mod that parses a blueprint and put landfill tiles under every entity in your blueprint, but ONLY where needed to build your blueprint.

Usage: The mod adds a small button in your top right corner. Simply take a blueprint in your hand and click it to convert your blueprint. Then just shift-click where you want your blueprint and sit back and watch your robots fill up the lake for you!

This can be used for every blueprint you want near or in a lake, but it's extra useful when putting down nuclear reactors that often require precise placement of landfill. I've tested this with a gigantic 2.4 GW blueprint without a problem.

The new copy function is a temporary blueprint, so the mod works on those too.

I haven't tested on modded entities but as long as they have a proper selection box that match the footprint of the entity they should work fine. Let me know otherwise.

WARNING: This permanently alters the blueprint *in your hand*. Your library is unaffected, but if you modify a blueprint in your inventory it will stay modified.

WARNING 2: This also removes any existing tiles in your blueprint - concrete, bricks and so on. This should not be a problem since if you take the blueprint from your library the original will still have concrete - you can put down the landfill and then take the original from your library again and stamp down the blueprint *with* concrete.

WARNING 3: This is my first program in lua and it's my first factorio mod - I will gladly accept suggestions for improvements, both functionality and the code. This is the first alpha release, provided without warranty!

This mod builds upon the shoulders of giants: The support for curved rail is straight up nicked from Blueprint Footprint by MostlyNumbers, an older mod that did almost the same thing but slightly different and hasn't been updated. My algorithm for regular entities is my own, though. I also got tips on how to handle blueprints from Foreman by Choumiko.

Known issues: This probably breaks if landfill isn't researched
beemer252025
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Mar 11, 2019 10:08 pm
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by beemer252025 »

Thanks for making this mod. I made a couple tweaks for my own use that I thought you might be interested in.
1) Added support for Dectorio which renames the landfill tile
2) Added a setting to also place landfill where there are tiles in the original blueprint
Attachments
settings.lua
(140 Bytes) Downloaded 184 times
info.json
(445 Bytes) Downloaded 179 times
control.lua
(6.25 KiB) Downloaded 183 times
landfiller.cfg
(334 Bytes) Downloaded 178 times
Hadramal
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Mar 09, 2019 5:11 pm
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by Hadramal »

Thanks! Glad you liked it, and I will absolutely see if I can incorporate your additions for the next release. The crash you had I don't think was because of Dectorio, but if you have it you probably do want Dectorios own landfill tile. Had a look at screenshots of the mod and it sure looks nice.

I was planning on testing what would happen if you kept existing tiles - best case would be that the landfill would be put down first - but I have little time until the weekend.
Hadramal
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Mar 09, 2019 5:11 pm
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by Hadramal »

Made a new version with some fixes and new features:

Version: 0.17.3
Changes:
- Attempts to add landfill tiles where the original blueprint had path tiles (brick, concrete...).
- Also now preserves existing landfill.
- Use Shift-click on the button for the old behaviour, only adding landfill under entities even if there are other tiles present.
- Control-click attempts to re-add the existing tiles, only mildly useful and only together with shift.
- Support added for the mod Platforms which adds a special type of removable landfill.
- Setting added for choosing between original landfill and Platforms
- Re-written button code, please report odd behaviour when migrating existing saves!

Bug fixes:
- Fixed crash when there was no entities at all in the blueprint
Tastaturtaste
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Dec 20, 2020 10:37 pm
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by Tastaturtaste »

Thanks for creating this mod. Since I am already playing Factorio version 1.1 and at the same time wanted to use the mod for some nuclear reactor and rail designs I had to update the mod manually.
To do this I bumped the version number and the factorio version. Additionally I removed the code for the rail offset and changed the ceil- function to the floor- function for calculating the entitiy start_x and start_y position.
With all these changes everything works as expected for me. All changed files are attached below. Please consider incorporating these changes so everyone can run your mod with Factorio 1.1.
Attachments
control.lua
(7.94 KiB) Downloaded 147 times
info.json
(507 Bytes) Downloaded 135 times
targetsan
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Jan 05, 2021 7:47 pm
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by targetsan »

Unfortunately mod still doesn't operate well with temporary blueprints or blueprints from library. Caused by control.lua:198 check, it fails if entity in hand isn't a real item.
User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 274
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by KiwiHawk »

Hi! I'm the current dev for the Sea Block pack, including the Landfill Painting mod. People were asking on the Sea Block reddit about modifying your mod to use the landfill tiles created by Landfill Painting.

Do you have your source code on GitHub? I can submit a pull request to add compatibility with Landfill Painting. I've already finished making the changes required.

Alternatively, I'm happy to help out with the maintenance of this mod if you add me as a collaborator.

https://mods.factorio.com/mod/LandfillPainting
https://www.reddit.com/r/Seablock/comme ... thing_mod/
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee
MisterFister
Fast Inserter
Fast Inserter
Posts: 104
Joined: Tue Jun 27, 2017 1:12 am
Contact:

Re: [MOD 0.17] Landfill Everything!

Post by MisterFister »

Thank you for making this wonderful mod!

There seems to be a replicable issue with this mod, and the crash-dialogue suggested that I report this information to the mod author.

The mod portal's information regarding this mod's update history would seem to imply that this is an actively supported mod. However, there have been no recent replies to recently-posted comments in either this thread, or on the discussions page of this mod's portal listing. Can someone please confirm that my info is being received? Thanks!

Info about the crash -- this crash seems to be triggered when attempting to click this mod's UI button with an inventory-blueprint-book in cursor. Individual blueprint-pages, whether in inventory or from the blueprint-library, does not seem to trigger this crash. Note that when attempting to click the UI button with a library-blueprint-book, this crash does not take place AND no mod-behavior takes place (i.e., it's a wasted click, albeit an inert one).

Code: Select all

First 2021 August 19, Second 2021 August 31, same savefile
Factorio v1.1.38
LandfillEverything v1.1.0
other mods installed, info available upon request


Imgur post of error notice, two identical-result instances from different dates


Dropbox folder with savefile, both identical error notices, and 3-part screengrab of list of mods
Post Reply

Return to “Mods”