TAG = GetStringParam("tag", "")
LAYER = GetIntParam("layer", 1)
MASK = GetIntParam("mask", 255)
ADD_INFO_TO_TAG = GetBoolParam("add_info_to_tag", false)

function init()
    local shapes = FindShapes(TAG)
    for i = 1, #shapes do
        local shape = shapes[i]
        SetShapeCollisionFilter(shape, LAYER, MASK)
        if ADD_INFO_TO_TAG then
            SetTag(shape, "layer", LAYER)
            SetTag(shape, "mask", MASK)
        end
    end
end
