NOTES:
- Doing this will disable achievements.
- SAVE the game world in case you screw this up.
- You need to be admin or in a single-player game to do this.
- This works on the vanilla game without any mods.
- Shallow water is always surrounded by shoreline, so changing 1 tile on bare ground actually changes a 3x3 area:
- Deep water is always surrounded by shallow water at least 1 tile wide. Inserting a single deep water tile on bare land will include a 3x3 ring of shallow water around it, plus a 5x5 ring of shoreline around the shallow water:
- Press F4 to show debug options, and select the second item in the list, "show-detailed-info", then press F4 again to hide debug options
- In the regular game view (not the map overview), your cursor position is shown on line 1 of the detailed info. Use your cursor to find the location(s) to be changed back to water.
Code: Select all
/command
local the_list={name = "water", position = {-53,42}}
game.player.surface.set_tiles{the_list}
To change a rectangular area of tiles, use the cursor to find two coordinates in opposite corners of a rectangle, and plug those numbers into the following script. (This script also works to change a single tile, if both corner coordinates are set to be the same.)
Change area from x=60, y=40 to x=50,y=45 to shallow water:
Code: Select all
/command
local Corner1={60,40}
local Corner2={50,45}
local table={}
local x=0
local y=0
local count=0
local StepX=1
local StepY=1
if (Corner1[1] > Corner2[1]) then StepX=-1 end
if (Corner1[2] > Corner2[2]) then StepY=-1 end
for x=Corner1[1],Corner2[1],StepX do
for y=Corner1[2],Corner2[2],StepY do
count=count+1
table[count]={name="water",position={x,y}}
end
end
game.player.surface.set_tiles(table)
[Search keywords: add water, add deep water, fix water, fix deep water, repair water, repair deep water, reactor grief, pump grief, reactor griefed, pump griefed, undo landfill, revert landfill, remove landfill]