Page 1 of 1

Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 10:41 am
by vanatteveldt
I've been going OCD on paving my base, paving everything with concrete and using brick paving to mark roads. I think the result is quite pretty:

Image

However, it really bothers me that I can't do anything with the waterfronts, as there are quite a couple of lakes in my base. I guess I could add the landfill mod, but it feels sort of nice to have the terrain to work around.

- Is there some sort of mod that allows me to pave up to the actual water, or give it an industrial quay / wharf front look?
- Can I plant trees on the waterfront to give it a bit of green / park like appearance? Maybe the treefarm mod can do that?

Thanks!

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 11:58 am
by prg
Run

Code: Select all

global.player=game.local_player
script.on_event(0, function(event)
    if event.tick % 10 ~= 0 then return end
    local tiles={}
    local p=global.player.position
    for x=-1,1 do
        for y=-1,1 do
            if not string.match(global.player.surface.get_tile(p.x+x, p.y+y).name, "water") then
                table.insert(tiles, {name="concrete", position={p.x+x,p.y+y}})
            end
        end
    end
    global.player.surface.set_tiles(tiles)
end)
to place concrete wherever you go, even next to water. This won't consume concrete from your inventory, so sacrifice a chest full of concrete with a shotgun or something if you feel this is cheaty.

Run

Code: Select all

script.on_event(0, nil)
to stop placing concrete again.

Run

Code: Select all

game.local_player.surface.create_entity{name="tree-0"..math.random(9), position=game.local_player.position}
to place a random tree.

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 12:35 pm
by vanatteveldt
Cool! I haven't played with lua yet, so this is a nice starter.

I'll sacrifice a chest of prime solar panels to placate Ford (or Armok :) )

Thanks!

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 1:05 pm
by prg
Oh and if you'd rather have a button to place trees instead of having to go through the console all the time, you can use

Code: Select all

game.local_player.gui.top.add{type="button", name="create-tree-button", caption="Create a tree!"}

script.on_event(1, function(event)
    if event.element.name=="create-tree-button" then
        local p = game.get_player(event.player_index)
        p.surface.create_entity{name="tree-0"..math.random(9), position=p.position}
    end
end)
To get rid of that button again,

Code: Select all

script.on_event(1, nil)
game.local_player.gui.top["create-tree-button"].destroy()

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 2:47 pm
by vanatteveldt
Thanks again for helping. Placing the concrete worked perfectly. Interestingly, after removing some concrete that I didn't want, it removed the nearby water as well.

I also wanted to place some stone bricks, but I get segfaults when I try either

Code: Select all

script.on_event(0, function(event)
    if event.tick % 10 ~= 0 then return end
    local tiles={}
    local p=global.player.position
    for x=-1,1 do
        for y=-1,1 do
            if not string.match(global.player.surface.get_tile(p.x+x, p.y+y).name, "water") then
                table.insert(tiles, {name="stone-brick", position={p.x+x,p.y+y}})
            end
        end
    end
    global.player.surface.set_tiles(tiles)
end)
or the simpler

Code: Select all

global.player=game.local_player
script.on_event(0, function(event)
 if event.tick % 10 ~= 0 then return end
 local tiles={}
 local p=global.player.position
 table.insert(tiles, {name="stone-brick", position={p.x, p.y}})
 global.player.surface.set_tiles(tiles)
end)
Even though "stone-brick" is what it seems to use in the recipe names. Any idea?


Edit: never mind, I managed to solve my (admittedly, pretty rich-world) problem by removing the concrete then replacing with brick manually. Of course, this deleted some water but there's no shortage of that.

The tree planting also works perfectly:

Image


Edit again: Strange enough, sometimes removing the concrete doesn't remove the water as well (in fact, I can't seem to reproduce it anymore. Maybe it only works from the north, and not from other directions. Any clue on the "stone-brick" script?

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 3:00 pm
by prg
The tile is called stone-path, not -brick. Though the game really shouldn't crash like that, you should report a bug about that.

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 3:09 pm
by Smarty
vanatteveldt wrote: The tree planting also works perfectly:

Image

wauw that looks fancy

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 3:39 pm
by vanatteveldt
prg wrote:The tile is called stone-path, not -brick. Though the game really shouldn't crash like that, you should report a bug about that.
Cool, thanks. I figured it was my own fault by meddling with the internals, but I'll submit a report. Thanks again!

@Smarty Thanks :). I'll post some screenies when I finish the redecoration, I think some parts of the factory are working quite well and I like the general shape of the layout.

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 3:42 pm
by prg
vanatteveldt wrote:I figured it was my own fault by meddling with the internals, but I'll submit a report.
When you're doing something wrong with the Lua API, the error needs to be detected and reported properly. The game must not segfault.

Re: Pave around water / is there a mod?

Posted: Fri Dec 04, 2015 4:31 pm
by bobucles
I think this is more the fault of there not being a "dock wall" type of decal. Normally when pavement reaches a watery edge like the ocean, a small wall is constructed so the pavement is stable. You see this sort of thing happen all the time in ye olde docking districts, where restaurants and such build right up to the ocean and there's no beach transition at all.

Re: Pave around water / is there a mod?

Posted: Wed May 17, 2017 4:26 pm
by mikeloeven
Sorry for the necro post but I think the OP has a point that there needs to be a mod to remove or at least tighten the concrete placement constraints. I was just trying to build a nice paved dock for a boat mod but this stupid and completely unneeded constraint regarding placement of concrete near water is causing a problem. So yeah would like someone to make a mod to fix this once and for all

Re: Pave around water / is there a mod?

Posted: Wed May 17, 2017 7:48 pm
by saturn7
You can remove the restriction for concrete placement in the lua files (I did it once, but I forget where exactly, I can search for it if you want); I don't know if there is a mod that does that. However placing concrete next to water sometimes bugs the water edge; the problem is that Factorio handles water edges in a weird way. For the same reason bots can't place landfill (they could once, but it has been disabled because it left holes, among other problems).

So the restriction is not arbitrary, but because there's a conflict with how Factorio handles the water edge.

Re: Pave around water / is there a mod?

Posted: Wed May 17, 2017 7:54 pm
by Optera