Page 1 of 1

indestructible tiles with collision masks?

Posted: Sun Jun 12, 2022 8:39 pm
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?

Re: indestructible tiles with collision masks?

Posted: Tue Jun 21, 2022 9:54 am
by darkfrei
Set the minable to false or replace tile-placeholder with the tile by the script.