Page 1 of 1

Default collision mask

Posted: Fri Jun 30, 2017 8:06 am
by evildogbot100
It seems to me that vanilla entities have default collision mask that is used when its prototype doesn't specify collision_mask. This makes it hard to iterate all entity that have a specific collision_mask. Example : I want to make all entity that has "object-layer" as collision_mask to get "layer-13" added to them. It seems to me there is no good way to manipulate that other than knowing beforehand all entities that defaults on having "object-layer" collision_mask. Or am I missing something here?

Re: Default collision mask

Posted: Fri Jun 30, 2017 8:59 am
by darkfrei
If none, then default.
collision_mask = { "item-layer", "object-layer", "player-layer", "water-tile"}
https://wiki.factorio.com/Types/CollisionMask

Re: Default collision mask

Posted: Fri Jun 30, 2017 9:56 am
by evildogbot100
The default is not that, for example belts don't have "player-layer" as collision_mask despite their collision_mask not specified in the data. It seems that different entity type has different default collision_mask, and that makes it difficult to iterate.

Re: Default collision mask

Posted: Fri Jun 30, 2017 11:03 pm
by Rseding91
Different entities have different collision masks and some will ignore the prototype values.

Some even change collision masks runtime (such as gates).

There's no built in way to iterate collision masks as they're not really intended to be changed and a lot of stuff starts to break when you do.