Need help with world generation

Place to get help with not working mods / modding interface.
patfre
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 15, 2020 1:59 pm
Contact:

Need help with world generation

Post by patfre »

So what i need help with is to make it so the hole world is water with 1 tile in the middle that is grass where the player spawns and also has 1 tree.
I do know how to make a custom world gen but not a world like what i want. How would i make that?
patfre
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 15, 2020 1:59 pm
Contact:

Re: Need help with world generation

Post by patfre »

Guess no one so far knows how :|
Bilka
Factorio Staff
Factorio Staff
Posts: 3367
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Need help with world generation

Post by Bilka »

How/where do you want to apply the map generation? Force it by default? Just a map gen preset? Or on surface creation? If on surface creation, control stage only or is data stage okay?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Need help with world generation

Post by PFQNiet »

Not something I've experimented with, but based on this rather in-depth guide I think this should work:

Code: Select all

local noise = require("noise")
data:extend{
  {
    type = "noise-expression",
    name = "point",
    intended_property = "elevation",
    expression = noise.define_noise_function(function(x, y, tile, map)
      return 0.5 - tile.distance
    end)
  }
}
This will add a new "Terrain type" (alongside "Normal" and "Island") that is an endless sea with a single tile at {0,0}.

Planting a tree can be done in control.lua.

Code: Select all

script.on_init(function()
  game.surfaces.nauvis.create_entity{
    name = "tree-01",
    position = {0.5,0.5},
    force = game.forces.neutral
  }
end)
Hope this helps!
patfre
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 15, 2020 1:59 pm
Contact:

Re: Need help with world generation

Post by patfre »

PFQNiet wrote: Mon Nov 16, 2020 2:06 pm Not something I've experimented with, but based on this rather in-depth guide I think this should work:

Code: Select all

local noise = require("noise")
data:extend{
  {
    type = "noise-expression",
    name = "point",
    intended_property = "elevation",
    expression = noise.define_noise_function(function(x, y, tile, map)
      return 0.5 - tile.distance
    end)
  }
}
This will add a new "Terrain type" (alongside "Normal" and "Island") that is an endless sea with a single tile at {0,0}.

Planting a tree can be done in control.lua.

Code: Select all

script.on_init(function()
  game.surfaces.nauvis.create_entity{
    name = "tree-01",
    position = {0.5,0.5},
    force = game.forces.neutral
  }
end)
Hope this helps!
Thanks this works just as what i wanted
gm.steeldragon
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Dec 28, 2024 2:29 am
Contact:

Re: Need help with world generation

Post by gm.steeldragon »

The 2.0 release has broken this, local noise = require("noise") specifically. Noise.lua is no longer included in the lualib.

I've looked in the new core/lualib folder, but I can't see where the new noise functions are...

Any suggestions on how to fix this?

PFQNiet wrote: Mon Nov 16, 2020 2:06 pm Not something I've experimented with, but based on this rather in-depth guide I think this should work:

Code: Select all

local noise = require("noise")
data:extend{
  {
    type = "noise-expression",
    name = "point",
    intended_property = "elevation",
    expression = noise.define_noise_function(function(x, y, tile, map)
      return 0.5 - tile.distance
    end)
  }
}
This will add a new "Terrain type" (alongside "Normal" and "Island") that is an endless sea with a single tile at {0,0}.

Planting a tree can be done in control.lua.

Code: Select all

script.on_init(function()
  game.surfaces.nauvis.create_entity{
    name = "tree-01",
    position = {0.5,0.5},
    force = game.forces.neutral
  }
end)
Hope this helps!
Post Reply

Return to “Modding help”