Tile optional property to prohibit replacement

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
garrotte
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Mar 10, 2020 5:10 pm
Contact:

Tile optional property to prohibit replacement

Post by garrotte »

Hello.
Please add an optional property for Tile Prototype to allow/prohibit replacement of this tile on surface with any other tiles. Allowed by default.

What is it for:
For some tiles there is an essential need to control how tile can be mined. Example: creep in Krastorio2 and Warmonger mods.

Right now there is only choice to prohibit mining completely, to slow down mining via mining_time and to prohibit deconstruction. So player use special scripted tools normally.
But still player can replace tile with other tile in a single click - ignoring mining time and killing the idea of tile protection and mining limitations.

Thank you.
Xorimuth
Filter Inserter
Filter Inserter
Posts: 693
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Tile optional property to prohibit replacement

Post by Xorimuth »

You can add a collision layer to your tile, and add it to all other item's place_as_tile.condition.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
User avatar
garrotte
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Mar 10, 2020 5:10 pm
Contact:

Re: Tile optional property to prohibit replacement

Post by garrotte »

Xorimuth wrote: Fri Apr 07, 2023 10:12 am You can add a collision layer to your tile, and add it to all other item's place_as_tile.condition.
Did you try this approach (for example to prevent concrete replacing) ? Will it work with all possible mineable tiles that any other mod can add to game?
I don't think this is relevant to my request.
User avatar
garrotte
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Mar 10, 2020 5:10 pm
Contact:

Re: Tile optional property to prohibit replacement

Post by garrotte »

In other words I believe game engine doesn't check for collision masks of two mineable tiles - just replaces one with another if other conditions for new tile are met.

IMHO, PlaceAsTile looks like the way to make tile placeable on water instead of ground and similar cases. But I didn't test it.
Xorimuth
Filter Inserter
Filter Inserter
Posts: 693
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Tile optional property to prohibit replacement

Post by Xorimuth »

garrotte wrote: Fri Apr 07, 2023 11:22 am
Xorimuth wrote: Fri Apr 07, 2023 10:12 am You can add a collision layer to your tile, and add it to all other item's place_as_tile.condition.
Did you try this approach (for example to prevent concrete replacing) ? Will it work with all possible mineable tiles that any other mod can add to game?
I don't think this is relevant to my request.
Yes, currently in my mod Freight Forwarding I have made landfill minable and used this 'collision' restriction on concrete to prevent placing concrete on top of landfill.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Post Reply

Return to “Modding interface requests”