Default collision mask

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Default collision mask

Post 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?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Default collision mask

Post by darkfrei »

If none, then default.
collision_mask = { "item-layer", "object-layer", "player-layer", "water-tile"}
https://wiki.factorio.com/Types/CollisionMask

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: Default collision mask

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13218
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Default collision mask

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding discussion”