Page 1 of 1
create new collision_mask
Posted: Fri May 08, 2020 2:51 pm
by ZmyLK
is it possible to creat a new collision_mask to avoid being incompatible with other mods?
Re: create new collision_mask
Posted: Fri May 08, 2020 3:52 pm
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
Re: create new collision_mask
Posted: Fri May 08, 2020 4:45 pm
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.
Re: create new collision_mask
Posted: Fri May 08, 2020 5:33 pm
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