I'm seeing a strange issue with GotLag's Explosive Excavation mod. This mod allows placing of water tiles, and adds an on_player_built_tile event handler that creates explosions when a water tile is placed.
When this mod is installed, sometimes random explosions are spawned when placing landfill (not water).
In these screenshots I had just clicked to place a large block of landfill. For some reason, factorio decided not to fill in the bottom row of the landfill brush. Apparently it still passed those coordinates to the on_player_built_tile handler, which, seeing water, spawned the explosions.
Since no landfill was placed in that bottom row, I would not expect the coordinates to be passed to the on_player_built_tile handler.
(I'd previously posted this bug in the Explosive Excavation forum thread here, reposting as a factorio bug report at authors request).
[0.15.37] Incomplete landfill placement,on_player_built_tiie
-
- Fast Inserter
- Posts: 110
- Joined: Wed Apr 05, 2017 2:17 am
- Contact:
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
Generally the idea is that the mod author makes the bug report if he assumes an issue with factorio itself.
complete control.lua:
complete control.lua:
Code: Select all
function placedTiles(entity, positions)
local surface = entity.surface
for i,pos in pairs(positions) do
if surface.get_tile(pos.x, pos.y).name == "water" then
local victim = surface.create_entity({name = "fish", position = {pos.x+0.5, pos.y+0.5}})
surface.create_entity({name = "blasting-projectile", force = entity.force, speed = 0, target = victim, position = victim.position})
victim.destroy()
end
end
end
script.on_event(defines.events.on_player_built_tile, function(event)
placedTiles(game.players[event.player_index], event.positions)
end)
script.on_event(defines.events.on_robot_built_tile, function(event)
placedTiles(event.robot, event.positions)
end)
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
It's a tile placement event triggered when the player is placing landfill tiles, but the set of positions returned apparently includes water tiles. I have not been able to reproduce it, but perhaps it depends on the geometry of the placed tiles.
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
I haven't looked into it but if I had to guess tile correction logic would be what I blame.
If you want to get ahold of me I'm almost always on Discord.
-
- Fast Inserter
- Posts: 110
- Joined: Wed Apr 05, 2017 2:17 am
- Contact:
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
I can reproduce it reliably, following the setup in the above screenshots exactly should work.GotLag wrote:It's a tile placement event triggered when the player is placing landfill tiles, but the set of positions returned apparently includes water tiles. I have not been able to reproduce it, but perhaps it depends on the geometry of the placed tiles.
1. Place a large block of landfill at with one click. Don't run around holding the mouse button down.
2. Place the landfill over deep water.
3. Place the landfill south(down) from existing land.
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
You're right, successfully reproduced it. Triggers reliably in all directions except when building to the west (left), but even then it still shows up at the upper/lower edges of the player's buildable range.
For testing I disabled all mods that modify tiles or hook into on_player_built_tile except for Explosive Excavation, so I don't think it's any weird mod interaction.
Edit: to be really clear, this only occurs on deep water tiles - is this due to the correction logic enforcing the presence of water between deep water and grass?
For testing I disabled all mods that modify tiles or hook into on_player_built_tile except for Explosive Excavation, so I don't think it's any weird mod interaction.
Edit: to be really clear, this only occurs on deep water tiles - is this due to the correction logic enforcing the presence of water between deep water and grass?
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
Most likely.GotLag wrote:You're right, successfully reproduced it. Triggers reliably in all directions except when building to the west (left), but even then it still shows up at the upper/lower edges of the player's buildable range.
For testing I disabled all mods that modify tiles or hook into on_player_built_tile except for Explosive Excavation, so I don't think it's any weird mod interaction.
Edit: to be really clear, this only occurs on deep water tiles - is this due to the correction logic enforcing the presence of water between deep water and grass?
If you want to get ahold of me I'm almost always on Discord.
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
So in essence, the tile correction is messing things up
Since we want to remove the tile correction, this will probably be fixed when its removed
Until then, it isn't a bug, as the code for tile correction is probably doing just exactly what it is meant to in the situation, and isn't worth investigating
Since we want to remove the tile correction, this will probably be fixed when its removed
Until then, it isn't a bug, as the code for tile correction is probably doing just exactly what it is meant to in the situation, and isn't worth investigating
Re: [0.15.37] Incomplete landfill placement,on_player_built_tiie
Fair enough, it's not exactly a pressing issue.