Closed slippycheeze closed 5 years ago
This is intentional, aside from trees (which can be mined as normal). They (again excepting trees) have no collision; why do you want to remove them?
They (again excepting trees) have no collision; why do you want to remove them?
Huh. They seem to block building things - rails, walls, buildings, etc - in the square they occupy. So, they are pretty little spots on the map that make it impossible to lay things out if you are unlucky. Jinking a train line around a tiny bush seems ... odd. ;)
If they are supposed to be possible to replace with stuff when building, something in my setup prevents that. If not... I guess that'd be the feature request?
Huh. They seem to block building things - rails, walls, buildings, etc - in the square they occupy.
That is not supposed to be the case; they are supposed to be like decoratives (though not removed like them when built over).
Can confirm.
I asked on the discord; this is a result of them colliding with water (so that they cannot exist on water); doing this also makes them collide with whatever collides with water...
Ah! Sounds like I'm not imagining things, and thank you so much for figuring that out. I'll be super-glad to have your shiny trees back soon. :)
I currently have no ideas as to a fix.
Sorry to add to a closed bug, but I read that you had not solution days ago and I did some research tonight, so when I came back to report what I found, I see you already have a solution. Anyway, this is what I found.
Line 202 in functions.lua -> collision_mask = {"water-tile"}, can be fixed with Line 202 in functions.lua -> collision_mask = {"colliding-with-tiles-only", "water-tile"}, as you have already learned. The problem could also be fixed by dropping the mask Line 202 in functions.lua -> collision_mask = {}, but this has the undesired effect of rendering the tile on water. However, I found that you already have two ways to combat that.
Line 82 in functions.lua -> if class == "bush" and (not water) then which seems to look for the word water in the name of the tile. This works for the base game and with all of your mods that I have loaded. There are no instances of the bush appearing in water when testing. I can imagine that some mods could creates a water tile and name it without using water in the title so this is a sub-optimal solution.
Line 23 in functions.lua -> if surface.can_place_entity{name = ename, position = {x, y}} and not isWaterEdge(surface, x, y) then uses isWaterEdge from World.lua in your core module. It seems to look at the layer property and prevent placement when an item is within a block of a water tile. I tested this as the only way to prevent water placement and found that it does not work. Partial line 2 in world.lua -> surface.get_tile{x-1, y}.prototype.layer == "water-tile" surface.get_tile{x, y}.prototype.layer returns an unsigned integer, but I seems like you are comparing it to a string. I didn't understand how this would work. More importantly, through testing, it didn't work and would allow water placement even thought every tile around it was a water tile.
I am not a good enough programmer to figure this out, or Factorio may have changed how this works in an update and now has broken one of your core functions, so I wanted to pass this on to you for you to ignore or not. I am not asking for you to do anything, but after all my testing I thought that this is a good a place to save the knowledge as any.
TL:TD Your solution seems to be the best, and the core isWaterEdge function doesn't seem to work as intended.
Your solution was my old solution, before I added the collision. It does nothing to address the case of when the water is added later.
I don't know if this is relevant, but I like having glowing plants floating on the water. :)
G'day. Looks like in the current version on 0.17, for me, plants spawn and glow, but can't be removed. Their interaction boxes and names show up fine, but none of these work:
Mod list, though: