[0.17] Painless landfill
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
[0.17] Painless landfill
There used to be a number of landfill mods. Out came 0.17 with an implementation of landfill in blueprints and most mods went away.
But, the 0.17 implementation of landfill is clunky, mainly because you have to add landfill to the blueprint for it to work... Clunky. There is a mod that let's you add landfill to your older blueprints, but... you are still messing with the blueprints.
This is what I think the ideal behavior would be:
- Blueprints stay clean, no landfill.
- If you shift-click a blueprint over water, it places the landfill, letting you place again for the blueprint (similar to 0.17 blueprint that has landfill in it).
- Landfill is automatically placed under objects or tiles that were saved in the blueprint. That way you can choose whether to cover a whole area (good for a factory) or just where the objects are (good for rail).
- If you press <ctrl><z> right after placing landfill, it removes it and returns it to your inventory.
- Any landfill placed becomes normal terrain dirt. So, if you ever remove the mod... there is no effect on the map save, and everything already placed will function fine in Vanilla.
Is there such a mod already? If no... this could easily become the standard mod for landfill, because it behaves very naturally and does what one would instinctively expect.
But, the 0.17 implementation of landfill is clunky, mainly because you have to add landfill to the blueprint for it to work... Clunky. There is a mod that let's you add landfill to your older blueprints, but... you are still messing with the blueprints.
This is what I think the ideal behavior would be:
- Blueprints stay clean, no landfill.
- If you shift-click a blueprint over water, it places the landfill, letting you place again for the blueprint (similar to 0.17 blueprint that has landfill in it).
- Landfill is automatically placed under objects or tiles that were saved in the blueprint. That way you can choose whether to cover a whole area (good for a factory) or just where the objects are (good for rail).
- If you press <ctrl><z> right after placing landfill, it removes it and returns it to your inventory.
- Any landfill placed becomes normal terrain dirt. So, if you ever remove the mod... there is no effect on the map save, and everything already placed will function fine in Vanilla.
Is there such a mod already? If no... this could easily become the standard mod for landfill, because it behaves very naturally and does what one would instinctively expect.
Re: [0.17] Painless landfill
That would be nice.zOldBulldog wrote: βTue Apr 16, 2019 9:02 am- If you shift-click a blueprint over water, it places the landfill, letting you place again for the blueprint (similar to 0.17 blueprint that has landfill in it).
Platforms is a mod that adds a type of landfill that you can remove again, like concrete (but you can put concrete on top of it if you want).zOldBulldog wrote: βTue Apr 16, 2019 9:02 am- If you press <ctrl><z> right after placing landfill, it removes it and returns it to your inventory.
- Any landfill placed becomes normal terrain dirt. So, if you ever remove the mod... there is no effect on the map save, and everything already placed will function fine in Vanilla.
I'm not sure what happens if you uninstall the mod but if we ask the author nicely then maybe he will add a migration script that automatically converts platforms to landfill when uninstalled if he already hasn't done that.
Re: [0.17] Painless landfill
BlueprintExtensions has had a rocky 0.4.x release series, but has the ability to add landfill to blueprints.zOldBulldog wrote: βTue Apr 16, 2019 9:02 amBut, the 0.17 implementation of landfill is clunky, mainly because you have to add landfill to the blueprint for it to work... Clunky. There is a mod that let's you add landfill to your older blueprints, but... you are still messing with the blueprints.
It has a few modes of operation, but by default it creates a temporary copy of the blueprint in question which is deleted when you hit "Q". (You can make the copy permanent simply by placing it in your inventory rather than clearing the cursor). So, while it fusses with blueprints, it will not modify your originals.
Mods currently have no way to detect a player placing a blueprint. (I believe it shows as several events for each ghost in the blueprint, but don't quote me that.) Thus, triggering off that behavior would be rather complicated.
A mod can't have migration scripts that run when the mod is uninstalled, because the mod is no longer there to provide said migration scripts.
Re: [0.17] Painless landfill
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: [0.17] Painless landfill
An option would be write a new mod to purely do the revert or recovery migrations.
Such a special mod should execute once and get removed/destroyed afterwards, Mission Impossible style!
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
A better option would be for the original author to include a command in his mod "/modname uninstall". Or if you want a masochistic "generic" solution you can write a mod that can replace arbitrary things on a map with other arbitrary things (i.e. a map-wide no-cost upgrade planner).Schallfalke wrote: βWed May 15, 2019 4:29 pmAn option would be write a new mod to purely do the revert or recovery migrations.
Such a special mod should execute once and get removed/destroyed afterwards, Mission Impossible style! 8-)
In any case you can only "uninstall" a mod while it it still installed, because otherwise the base game will automatically migrate everything that mod added into the void. :p
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [0.17] Painless landfill
Or it could be a simple command. Why commands disable achievements I don't know but there's a mod (Someone's Lua Console) that adds a console that doesn't disable your achievements.
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: [0.17] Painless landfill
Be reminded that we, as modders, know entering console commands, does not mean that many players know and/or want to do that.
In their point of view, download and enable a mod is a thousand times easier than inputting some console commands.
And in the programming point of view, doing a simple JSON migration file to revert back entities is much simpler than some control script to replacing entities on-fly. Plus may need additional script to prevent griefers abusing the command on multiplayer servers.
At least I won't provide such powerful commands in any of my own mods. It brings much more problem than a simple JSON migration file.
In their point of view, download and enable a mod is a thousand times easier than inputting some console commands.
And in the programming point of view, doing a simple JSON migration file to revert back entities is much simpler than some control script to replacing entities on-fly. Plus may need additional script to prevent griefers abusing the command on multiplayer servers.
At least I won't provide such powerful commands in any of my own mods. It brings much more problem than a simple JSON migration file.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
As far as i know the *only* command that disables achievements is "/c". Case in point: My mod /sudo does not disable achievements (except for the vanilla ones, because obviously my mod is a mod :p).
In my experience most people prefer to enter a quick command to get it over with over trying 5 different mods that each only solve part of the problem.Schallfalke wrote: βWed May 15, 2019 9:16 pmBe reminded that we, as modders, know entering console commands, does not mean that many players know and/or want to do that.
In their point of view, download and enable a mod is a thousand times easier than inputting some console commands.
Except the engine doesn't support that.Schallfalke wrote: βWed May 15, 2019 9:16 pmAnd in the programming point of view, doing a simple JSON migration file to revert back entities is much simpler than some control script to replacing entities on-fly.
Not really. It's trivial to check "if Player.admin then". "/modname uninstall" Wasn't my idea either, there are actually mods out there already doing that.Schallfalke wrote: βWed May 15, 2019 9:16 pmPlus may need additional script to prevent griefers abusing the command on multiplayer servers.
At least I won't provide such powerful commands in any of my own mods. It brings much more problem than a simple JSON migration file.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [0.17] Painless landfill
Yeah I meant a /c code command console when I said consoleeradicator wrote: βThu May 16, 2019 7:03 amAs far as i know the *only* command that disables achievements is "/c". Case in point: My mod /sudo does not disable achievements (except for the vanilla ones, because obviously my mod is a mod :p).
Try /editor next time you want to disable your achievements
Tell Wube about it:eradicator wrote: βThu May 16, 2019 7:03 amExcept the engine doesn't support that.Schallfalke wrote: βWed May 15, 2019 9:16 pmAnd in the programming point of view, doing a simple JSON migration file to revert back entities is much simpler than some control script to replacing entities on-fly.
I agree with you on the other thing you wrote q:https://lua-api.factorio.com/latest/Migrations.html wrote:JSON Prototype migrations allow changing one prototype to another prototype. Typically this is done when re-naming something.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
You want me to implement /sudo editor ?
Maybe i read @Schallfalke wrong there. I do know migrations exist. But only as long as the mod containing them is loaded. So using a migration to "uninstall" would be:Qon wrote: βThu May 16, 2019 8:43 amTell Wube about it:eradicator wrote: βThu May 16, 2019 7:03 amExcept the engine doesn't support that.Schallfalke wrote: βWed May 15, 2019 9:16 pmAnd in the programming point of view, doing a simple JSON migration file to revert back entities is much simpler than some control script to replacing entities on-fly.I agree with you on the other thing you wrote q:https://lua-api.factorio.com/latest/Migrations.html wrote:JSON Prototype migrations allow changing one prototype to another prototype. Typically this is done when re-naming something.
- Install Mod_you_don't_like
- Install Uninstaller_for_mod_you_don't like
- Uninstall Mod_you_don't_like
- Uninstall Uninstaller_for_mod_you_don't like
Edit: Tried uninstalling Alien Biomes as a test, and all tiles are migrated to "grass-1". So...er, what was the original problem again?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: [0.17] Painless landfill
Assume the player is still using the "XYZ" mod in one's game, I would instruct the following steps:eradicator wrote: βThu May 16, 2019 10:04 amMaybe i read @Schallfalke wrong there. I do know migrations exist. But only as long as the mod containing them is loaded. So using a migration to "uninstall" would be:
And i'm not at all sure what the engine thinks about you when you try to "migrate" away a prototype that still exists. As migrations are meant to rename things *after* removing the prototype.
- Install Mod_you_don't_like
- Install Uninstaller_for_mod_you_don't like
- Uninstall Mod_you_don't_like
- Uninstall Uninstaller_for_mod_you_don't like
- Download and enable "XYZ Uninstaller".
- Disable "XYZ".
- Load savegame, migrations will apply upon loading.
- Save game with a different name.
- Repeat from 3, if you have other savegames also using the mod.
- Disable "XYZ Uninstaller".
- Now the mod list should be without "XYZ" or "XYZ Uninstaller". Load savegame and see if everything is alright.
- Safe to remove "XYZ" or "XYZ Uninstaller".
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
@Schallfalke:
Hm..yea, that would work. I forgot that you can disable the old mod before loading with the new one. Though nonetheless such a tool would preferably have to be maintained by the original mod author.
Which brings me back to my last question: What problem exactly was this supposed to solve again?
-------
Hm..yea, that would work. I forgot that you can disable the old mod before loading with the new one. Though nonetheless such a tool would preferably have to be maintained by the original mod author.
Which brings me back to my last question: What problem exactly was this supposed to solve again?
-------
My working theory is that blueprint placement can be detected by a) the player holding a blueprint item, and b) it being unlikely that the player places more than one ghost per tick manually.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: [0.17] Painless landfill
Guess it comes from the following:eradicator wrote: βThu May 16, 2019 11:39 amWhich brings me back to my last question: What problem exactly was this supposed to solve again?
Qon wrote: βTue Apr 16, 2019 10:23 pmPlatforms is a mod that adds a type of landfill that you can remove again, like concrete (but you can put concrete on top of it if you want).zOldBulldog wrote: βTue Apr 16, 2019 9:02 am- If you press <ctrl><z> right after placing landfill, it removes it and returns it to your inventory.
- Any landfill placed becomes normal terrain dirt. So, if you ever remove the mod... there is no effect on the map save, and everything already placed will function fine in Vanilla.
I'm not sure what happens if you uninstall the mod but if we ask the author nicely then maybe he will add a migration script that automatically converts platforms to landfill when uninstalled if he already hasn't done that.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
The assumption being that any modded tile will revert to "grass-1" when uninstalled.eradicator wrote: βThu May 16, 2019 10:04 amEdit: Tried uninstalling Alien Biomes as a test, and all tiles are migrated to "grass-1". So...er, what was the original problem again? :oops:
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: [0.17] Painless landfill
Or (in modding-ignorant noob language)... make it grass-1 from the moment it gets placed instead of using special newly invented blocks. If there is no difference between the mod-placed block and a vanilla-placed block, then there is nothing to change when you uninstall.eradicator wrote: βThu May 16, 2019 12:00 pmThe assumption being that any modded tile will revert to "grass-1" when uninstalled.eradicator wrote: βThu May 16, 2019 10:04 amEdit: Tried uninstalling Alien Biomes as a test, and all tiles are migrated to "grass-1". So...er, what was the original problem again?
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: [0.17] Painless landfill
Guess "grass-1" is the default and filler tile, because there cannot be "no tiles" at all for any spot.eradicator wrote: βThu May 16, 2019 12:00 pmThe assumption being that any modded tile will revert to "grass-1" when uninstalled.eradicator wrote: βThu May 16, 2019 10:04 amEdit: Tried uninstalling Alien Biomes as a test, and all tiles are migrated to "grass-1". So...er, what was the original problem again?
There is a "not-on-map" tile, but maybe it is only good for scenarios with limited map size. The devs decided not to apply it as default.
Re: [0.17] Painless landfill
The tile placed by Platforms must be a unique platform tile or store some sort of data for each landfilled/platformed tile somewhere else for it to be removable while still making sure you can't pick up any tile. And storing which tiles were platformed in the tile data type is the natural place to store that data and make platforms have a unique look with support from the game engine.zOldBulldog wrote: βThu May 16, 2019 12:10 pmOr (in modding-ignorant noob language)... make it grass-1 from the moment it gets placed instead of using special newly invented blocks. If there is no difference between the mod-placed block and a vanilla-placed block, then there is nothing to change when you uninstall.
So if Platforms placed grass-1 then the platforms would be regular landfill OR it would just be an OP 'waterfill anywhere' type of mod, both of which are already existing types (the bad vanilla behaviour and a bit OP mod) that Platforms was specifically designed to be different from. When landfill tiles are no longer grass-1 (which are also commonly spawned by map generator) but instead a unique landfill tile then the mod could just make that type of tile removable without introducing a new type of tile.
So the problem is that the map generator spawns the same tile, grass-1, as landfilling does so you "can't" know which tiles were landfilled and which tiles are natural. What you are suggesting in the quote is exactly what landfill already does, and that is why it is 'painful'.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.17] Painless landfill
If every removed tile became not-on-map, then removing alien biomes would leave the map 90% unusable and unplayable as not-on-map can not be landfilled, walked upon or whatever.Schallfalke wrote: βThu May 16, 2019 12:32 pmGuess "grass-1" is the default and filler tile, because there cannot be "no tiles" at all for any spot.
There is a "not-on-map" tile, but maybe it is only good for scenarios with limited map size. The devs decided not to apply it as default.
Nope. Landfill uses the same graphic as "grass-1", but internally it uses a seperate "landfill" tile (see data\base\prototypes\tile\tiles.lua). Try standing on landfill and /sudo count_tiles() :p.Qon wrote: βThu May 16, 2019 1:04 pmSo the problem is that the map generator spawns the same tile, grass-1, as landfilling does so you "can't" know which tiles were landfilled and which tiles are natural. What you are suggesting in the quote is exactly what landfill already does, and that is why it is 'painful'.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: ζ₯ζ¬θͺ, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [0.17] Painless landfill
I remembered them saying that landfill was the same tile as grass from some FFF a while ago and that they were thinking of changing it to a separate tile. But I could be mistaken and what they said was what you just said and I warped it from looking similar to being the same thing. Or maybe it changed from how it was when it was introduced. I didn't play 0.16 so I have missed a lot of changelogs. Or maybe it was never so in vanilla but it was so when Landfill was a mod.eradicator wrote: βThu May 16, 2019 2:20 pmNope. Landfill uses the same graphic as "grass-1", but internally it uses a seperate "landfill" tile (see data\base\prototypes\tile\tiles.lua). Try standing on landfill and /sudo count_tiles() :p.Qon wrote: βThu May 16, 2019 1:04 pmSo the problem is that the map generator spawns the same tile, grass-1, as landfilling does so you "can't" know which tiles were landfilled and which tiles are natural. What you are suggesting in the quote is exactly what landfill already does, and that is why it is 'painful'.
Checking factorio wiki:
Hey I was right, it was like I said! I mean, of course I'm right, I'm always right. Erhhmm...https://wiki.factorio.com/Landfill#History wrote: 0.17.10:
Landfill is now a separate tile, differentiated from grass-1.
Thanks for telling me that it's different now though.
Well, platforms was first released in 0.16 so that's the reason it introduces a unique 'landfill' tile, there was none back then it could use. And platforms have a different recipe so you can still use landfill with the mod installed. But I guess a new Platforms update or version could be made that makes landfill work like platforms but still use the landfill tile (maybe reskinned to look like platforms) so you can install it whenever and pull up landfilled areas that you filled before you installed the mod. And you would just lose the ability (temporarily while the mod is disabled) to remove landfill if it was uninstalled and get it back when you re-installed. And you wouldn't lose any landfill/platforms in chests and can use the regular stone recipe.