not_colliding_with_itself does not appear to function under certain conditions

Place to get help with not working mods / modding interface.
killzoms
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 08, 2026 11:24 pm
Contact:

not_colliding_with_itself does not appear to function under certain conditions

Post by killzoms »

used Collision mask that collides with a different Entity with a duplicate collision mask

Code: Select all

collision_mask = {
    layers = {
        player = true,
        car = true,
        train = true,
        is_object = true,
        layer_52 = true
    },
    consider_tile_transitions = true,
    not_colliding_with_itself = true
}
The exact example where this comes into play is with the [Mobile Factory](https://mods.factorio.com/mod/Mobile_Factory_zoms/) mod, at the moment I have removed the Player collision layer(not ideal) and added the water_tile layer, this of course causes it to collide with Belts which is no fun and does not allow crossing shallow water(as expected)
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4539
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by boskid »

So what are the conditions where it does not work?
killzoms
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 08, 2026 11:24 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by killzoms »

When attempting to place the MF Deploy entity that has the same collision mask as the Mobile Factory entity, having the player collision mask layer enabled causes not_colliding_with_itself to not function.

Code that copies the collision mask is

Code: Select all

local MobileFactory = data.raw.car.MobileFactory
local MFDeploy = data.raw["simple-entity-with-owner"].MFDeploy

MFDeploy.collision_mask = table.deepcopy(MobileFactory.collision_mask)
while code that declares the collision mask is

Code: Select all

mf.collision_mask = {
    layers = {
        player = true,
        car = true,
        train = true,
        is_object = true,
        layer_52 = true
    },
    consider_tile_transitions = true,
    not_colliding_with_itself = true
}
with mf being a copy of the tank

if the player collision layer is not enabled then not_colliding_with_itself functions as described. I suppose I should mention this is all done in Factorio's latest steam update
Attachments
Without player collision_mask layer
Without player collision_mask layer
Screenshot_20260509_165958.png (248.81 KiB) Viewed 302 times
With player collision_mask layer
With player collision_mask layer
Screenshot_20260509_164734.png (318.85 KiB) Viewed 302 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4539
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by boskid »

So let me summarize your findings: you have two collision masks that have non equal set of layers (one has player layer while other one does not) and you are claiming that not_colliding_with_itself which requires equal set of layers is not working. Do you see your problem?
killzoms
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 08, 2026 11:24 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by killzoms »

boskid, The collision masks are equal, the collision mask of MF Deploy is set directly with a deepcopy of the collision mask of Mobile Factory.

Player is set on both. The only reason I mentioned Player is because I tested with player set and without it set on both since MF Deploy's collision mask is just a copy of Mobile factory's collision mask.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4539
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by boskid »

Can you show the relevant collision masks as they are seen by the game in prototype explorer (ctrl+shift+e while in game then navigate to related prototypes and show their collision masks)?
killzoms
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 08, 2026 11:24 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by killzoms »

Here are the relevant collision masks. Where did Vehicle come from?
Attachments
Screenshot_20260509_223224.png
Screenshot_20260509_223224.png (80.52 KiB) Viewed 218 times
Screenshot_20260509_223303.png
Screenshot_20260509_223303.png (68.06 KiB) Viewed 218 times
killzoms
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 08, 2026 11:24 pm
Contact:

Re: not_colliding_with_itself does not appear to function under certain conditions

Post by killzoms »

I see. Alien Biomes changes the collision mask layers on all cars if they have the player layer.


Disregard this topic, Did not realize a mod adding additional biomes would additionally modify all CarPrototypes.
Post Reply

Return to “Modding help”