Help with collision_mask

Place to get help with not working mods / modding interface.
Post Reply
Jaren Taq
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Nov 28, 2020 8:26 am
Contact:

Help with collision_mask

Post by Jaren Taq »

Hello,

I have two prototype classes, basically markers for the floor, which might share the same position but should collide with other entities:

Code: Select all

-- same "class"
-- should collide with objects, itself, proto_b, but not with proto_c, proto_d
proto_a.collision_mask = {"object-layer", "transport-belt-layer", "floor-layer", "water-tile"}
-- should collide with objects, itself, proto_a, but not with proto_c, proto_d
proto_b.collision_mask = {"object-layer", "transport-belt-layer", "floor-layer", "water-tile"}
-- different "class"
-- should collide with objects, itself, proto_d, but not with proto_a and proto_b
proto_c.collision_mask = {"object-layer", "transport-belt-layer", "floor-layer", "water-tile"}
-- should collide with objects, itself, proto_c, but not with proto_a and proto_b
proto_d.collision_mask = {"object-layer", "transport-belt-layer", "floor-layer", "water-tile"}
Is there a possibility to do something like this without wasting using 8 additional collision layers?

Thanks, Jaren

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

Re: Help with collision_mask

Post by darkfrei »

Just add two extra collision layers.
Attachments
collisions_abcd.png
collisions_abcd.png (5.23 KiB) Viewed 657 times

Post Reply

Return to “Modding help”