CanalBuilder Simplified


Dig shallow canals to extend or connect bodies of water. - Adds waterfill - Players and vehicles are slowed down in shallow water

Utilities
a month ago
1.1 - 2.0
25.8K
Environment Fluids

i Announce set tiles event

28 days ago
(updated 28 days ago)

Hi! Could the mod set "raise_event=true" on "surface.set_tiles(tileArray)" to announce the tile change? (if player placed tiles it can already be captured by events but canal builder omits that)

Additional idea that I'd appreciate for my mod as an event receiver: pass old tile name in tileArray data as in
(this thread claims its possible: "If you are raising the event using script.raise_script_set_tiles inside of the table next to the mandatory fields you may pass additional fields that will be delivered to the event receiver."
https://forums.factorio.com/viewtopic.php?t=90456):

local current_position = {pos.x + x, pos.y}
local old_tile = surface.get_tile(current_position.x , current_position.y)
tileArray[i] = {
name = replacement,
position = current_position ,
old_name=old_tile.name
}

(would need to test it to be 100% it works correctly as the thread mentioned)
I can prepare an example PR and test it if you're open to implementing these ideas.

New response