Terrain Generation

Place to get help with not working mods / modding interface.
User avatar
PoisonedPorkchop
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 16, 2017 12:04 am
Contact:

Terrain Generation

Post by PoisonedPorkchop »

I've spent some hours trying to figure out the map generation, without much success.
That being said, I am new to modding factorio, and new to lua (though I have extensive experience in java and C#, lua is a bit different).

I'm trying to figure out how to make a new Surface that uses custom world generation. By this I mean I want to be able to replace the ground and water tiles with my own defined tiles. If I'm not wrong, the function I need to use is lua-api.factorio.com/0.15.21/LuaGameScript.html#LuaGameScript.create_surface. There isn't a problem making the surface, but the problem with the MapGenSettings, lua-api.factorio.com/0.15.21/Concepts.html#MapGenSettings, is that the autoplace_settings field appears to be used for things like ores etc. (with the frequency and richness modifiers being specified). The other settings don't have anything to do with world generation, so I must be missing something. Here I stand on my custom Surface, that is nothing but an ordinary world. On a side note, how do I correctly specify the autoplace_settings in MapGenSettings? What I used for generating my surface was some code in my control.lua

Code: Select all

game.create_surface("Custom",{terrain_segmentation="none",water="none",autoplace_controls={copper_ore={frequency="very-high",size="very-high",richness="very-high"}},seed=542342,{0,0},width=0,height=0,starting_area="normal",peaceful_mode=true})
Copper ore (or any ore i specified) seemed to remain unchanged.

If what I am trying to do isn't possible, that's fine, but if there's even an obscure or cheaty way of doing it, I'm up for it. Thanks in advance!
What is it that you think you know?
NOTHING KSCHAEB WEOMNOTC I.dont.forget
qwertiyuiopasdfghsjklzxcvebnemgenviehrty
321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Terrain Generation

Post by 321freddy »

You wrote copper_ore instead of copper-ore and you forgot to specify the shift value.
So the command should look more like this:

Code: Select all

game.create_surface("Custom", {
     terrain_segmentation = "none",
     water = "none",
     autoplace_controls = {
         ["copper-ore"] = {
             frequency = "very-high",
             size = very-high",
             richness = very-high"
         }
     },
     seed = 542342,
     shift = {0, 0},
     width = 0,
     height = 0,
     starting_area = "normal",
     peaceful_mode = true
})
User avatar
PoisonedPorkchop
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 16, 2017 12:04 am
Contact:

Re: Terrain Generation

Post by PoisonedPorkchop »

321freddy wrote:You wrote copper_ore instead of copper-ore and you forgot to specify the shift value.
So the command should look more like this:

Code: Select all

game.create_surface("Custom", {
     terrain_segmentation = "none",
     water = "none",
     autoplace_controls = {
         ["copper-ore"] = {
             frequency = "very-high",
             size = very-high",
             richness = very-high"
         }
     },
     seed = 542342,
     shift = {0, 0},
     width = 0,
     height = 0,
     starting_area = "normal",
     peaceful_mode = true
})
Thanks for clarifying that, but my original question remains... How do I change ground and water tiles to be generated with my own tiles?
What is it that you think you know?
NOTHING KSCHAEB WEOMNOTC I.dont.forget
qwertiyuiopasdfghsjklzxcvebnemgenviehrty
Post Reply

Return to “Modding help”