indestructible tiles with collision masks?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

indestructible tiles with collision masks?

Post by adamwong246 »

Code: Select all

local CollisionMaskUtil = require("__core__.lualib.collision-mask-util")
local layer = CollisionMaskUtil.get_first_unused_layer()

-- you CAN pave over Garbage fill
local garbageFillMask = {"ground-tile", "colliding-with-tiles-only", layer}

-- you CAN NOT pave over a Sacfice Zone
local sacrificeZoneMask = {"ground-tile", "water-tile", "floor-layer", "item-layer", "object-layer",
                       "colliding-with-tiles-only", layer}
The goal is to make 2 new tiles, GarbageFill and SacrificeZone. The problem is that you can still remove SacrificeZone and replace it with GarbageFill. Ideally, SacrificeZone tile should be permanent. Is there a way to achieve this with collision masks?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: indestructible tiles with collision masks?

Post by darkfrei »

Set the minable to false or replace tile-placeholder with the tile by the script.

Post Reply

Return to “Modding help”