raiguard / EditorExtensions

Extends the Factorio map editor with new features, testing tools, and other utilities to aid with sandbox play and scenario creation.
https://mods.factorio.com/mod/EditorExtensions
Other
26 stars 6 forks source link

Feature Request: Allow filling surface with lab tile pattern #131

Closed USSX-Hares closed 1 year ago

USSX-Hares commented 1 year ago

Description

By now, editor extensions allow to use lab tile 1 and lib tile 2, but there is no option to fill the selected area with the alternating color pattern.

Reproduction

No response

raiguard commented 1 year ago

image You can fill a whole surface with lab tiles in the editor. Are you asking for a selection tool instead?

USSX-Hares commented 9 months ago

image You can fill a whole surface with lab tiles in the editor. Are you asking for a selection tool instead?

Well, yes, I was asking for a selection tool. Have found a workaround with the selection tool script execution:

local tiles = { }
local tile_types = { [0] = "lab-dark-1", [1] = "lab-dark-2" }

game.player.print(string.format("Replacing tiles on region from (%i, %i) to (%i, %i)...", area.left_top[1], area.left_top[2], area.right_bottom[1], area.right_bottom[2]))

for x = area.left_top[1], area.right_bottom[1] - 1
do
    for y = area.left_top[2], area.right_bottom[2] - 1
    do table.insert(tiles, { position={ x, y }, name=tile_types[(x+y) % 2] })
    end
end

game.player.surface.set_tiles(tiles, false)