Page 1 of 1

Tile optional property to prohibit replacement

Posted: Fri Apr 07, 2023 8:48 am
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.

Re: Tile optional property to prohibit replacement

Posted: Fri Apr 07, 2023 10:12 am
by Xorimuth
You can add a collision layer to your tile, and add it to all other item's place_as_tile.condition.

Re: Tile optional property to prohibit replacement

Posted: Fri Apr 07, 2023 11:22 am
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.

Re: Tile optional property to prohibit replacement

Posted: Fri Apr 07, 2023 12:10 pm
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.

Re: Tile optional property to prohibit replacement

Posted: Fri Apr 07, 2023 1:09 pm
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.