An immovable "garbagefill" tile

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Dec 01, 2020 5:01 am
Contact:

An immovable "garbagefill" tile

Post by adamwong246 »

I've made a polluting tile called "garbagefill". Is there a way to make this indestructible?

I found that by setting the minable property to nil, you can concrete over the "garbagefill" but this also allows you to landfill over a garbagefill, which is not a desired effect.

If I set the minable property, you can no longer concrete over garbagefill without mining it, also undesired.

How can I achieve both effects- a tile that CAN be concreted over but NOT landfilled over?

Pi-C
Smart Inserter
Smart Inserter
Posts: 1086
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: An immovable "garbagefill" tile

Post by Pi-C »

adamwong246 wrote:
Fri Feb 19, 2021 6:44 pm
How can I achieve both effects- a tile that CAN be concreted over but NOT landfilled over?
Not sure if this can be achieved with prototype definitions. However, you could listen to the relevant events (on_X_built_tile, on_X_mined_tile, and script_raised_set_tiles; replace 'X' with "player' or 'robot') in the control stage. If one of your tiles is removed, you can then just revert the change.

The built/mined events will tell you what old tile has been replaced/removed. The same is not true for script_raised_set_tiles, so you should store the coordinates of all your garbage tiles in your mod's global table. In case you're interested, we do something similar (with "Musk floor" tiles) in Bio Industries.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding discussion”