create new collision_mask

Place to get help with not working mods / modding interface.
ZmyLK
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri May 08, 2020 10:38 am
Contact:

create new collision_mask

Post by ZmyLK »

is it possible to creat a new collision_mask to avoid being incompatible with other mods?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3730
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: create new collision_mask

Post by DaveMcW »

No, the masks listed here are all you get: https://wiki.factorio.com/Types/CollisionMask

Here is a discussion of workarounds: viewtopic.php?t=74786
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: create new collision_mask

Post by darkfrei »

ZmyLK wrote: Fri May 08, 2020 2:51 pm is it possible to creat a new collision_mask to avoid being incompatible with other mods?
Set them in the mod settings.lua:

Code: Select all

data:extend({
    {
        type = "string-setting",
        name = "my-mod-collision-mask",
        setting_type = "startup",
        default_value = "layer-11",
        allowed_values = {"layer-11", "layer-12", "layer-13", "layer-14", "layer-15"}
    }
})
data.lua:

Code: Select all

local collision_mask = settings.startup["my-mod-collision-mask"].value
So if this mask was used, the player can change it onto the another one. It's much better than hardcoded, but not as good as automatically chosen collision mask.
Hiladdar
Fast Inserter
Fast Inserter
Posts: 214
Joined: Mon May 14, 2018 6:47 pm
Contact:

Re: create new collision_mask

Post by Hiladdar »

There are several unused masks, and it is possible to use one of those for a mod. The issue is that if in the future that mask is appropriated for something specific within the game, it would blow the mod out of the water. The other issue, is if that same mask is used by two different mod authors, in which case the both mods will be mutually incompatible with each other.

I did look into that, and it can work, but the risk is to great that it may cause the to mod to be incompatible with some other mod, or get broken if Webe chooses to use that mask for something else.

Hiladdar
Post Reply

Return to “Modding help”