How to change/remove water+cliffs from the Map genertor

Place to get help with not working mods / modding interface.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 3085
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How to change/remove water+cliffs from the Map genertor

Post by mrvn » Sun Feb 10, 2019 3:17 pm

Hi,

I'm working on a mod that takes over map generation and creates a maze. For this my data.lua contains:

Code: Select all

log("- cliffs and water")
local noise = require "noise"
local tne = noise.to_noise_expression
data.raw['noise-expression']['default-cliffiness'].expression =
  noise.define_noise_function(function(x, y, tile, map)
    return 0
  end)
data.raw['noise-expression']['default-elevation'].expression =
  noise.define_noise_function(function(x, y, tile, map)
    return 100
  end)
This removes all the cliffs and nearly all the water. Is that the right way to go about it or is there a better way to disable the generation of water and cliffs?

Problem 1: The water in the starting area is left behind. What am I missing there to get no water at all?

Problem 2: In the "Map generator" dialog the "Terrain settings" contain an entry for Water. I would like to have water appear under "Resource settings" instead.

The maze has narrow ways and any natural lake would block the way. So water is limited to dead ends (and maybe as lakes in larger caverns in the future). Given that you need water for steam engines and in mods for various other recipes it's more of a resource that needs to be found in the maze.

Problem 3: In the "Map generator" dialog the "Terrain settings" contain an entry for cliffs. How do I remove that?

The walkable spaces of the maze are bordered by cliffs to give a nicer looking border and the narrow passages must not have any cliffs or the player would quickly be blocked in. That's why I disabled the cliffs through the noise layer above. But that makes the cliff config in the map generator pointless.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 1877
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How to change/remove water+cliffs from the Map genertor

Post by darkfrei » Sun Feb 10, 2019 5:51 pm

Code: Select all

/c mgs = game.player.surface.map_gen_settings
mgs.cliff_settings = {name="cliff", cliff_elevation_0=0, cliff_elevation_interval=0}
game.player.surface.map_gen_settings = mgs

mrvn
Smart Inserter
Smart Inserter
Posts: 3085
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to change/remove water+cliffs from the Map genertor

Post by mrvn » Mon Feb 11, 2019 11:25 am

darkfrei wrote:
Sun Feb 10, 2019 5:51 pm

Code: Select all

/c mgs = game.player.surface.map_gen_settings
mgs.cliff_settings = {name="cliff", cliff_elevation_0=0, cliff_elevation_interval=0}
game.player.surface.map_gen_settings = mgs
There is no game object prior to the map being already generated and the game running. The map_gen_settings just reflect what was selected when generating the map, not what is available to select.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users