[SOLVED]Make entity collide with concrete/stone tiles
[SOLVED]Make entity collide with concrete/stone tiles
I'D like to make my entity collide with concrete/stone tiles, but it appears they have no collision layer assigned and my tries to assign a collision layer have been unsuccessful. Is there any other way to do so?
Last edited by Villfuk02 on Tue May 01, 2018 2:02 pm, edited 1 time in total.
Re: Make entity collide with concrete/stone tiles
I tried exactly the same thing again and it worked. I guess i made a mistake on my first try.
This is the working code:
This is the working code:
Code: Select all
for index,tile in pairs(data.raw.tile) do
if string.find(tile.name, "concrete") or string.find(tile.name, "path") then
tile.collision_mask = {"layer-15"}
end
end
Re: [SOLVED]Make entity collide with concrete/stone tiles
https://mods.factorio.com/mod/CheckerFloor - added collision "layer-15" and you can't place new tiles on "same" tiles.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [SOLVED]Make entity collide with concrete/stone tiles
table.insert(tile.collision_mask,"layer-15")
Otherwise it will collide with nothing _but_ layer-15. Unless you want to be able to place it on top of any other tile, like water etc.
Otherwise it will collide with nothing _but_ layer-15. Unless you want to be able to place it on top of any other tile, like water etc.
Re: [SOLVED]Make entity collide with concrete/stone tiles
Yep, i didn't think of that, thanks for pointing it out!