Page 1 of 1

How do you add new ore generation

Posted: Wed Mar 23, 2016 11:58 pm
by Solar's Wrath
Hello, I'm new in the forum. I have been looking for how to add new ore, I looked through some other mods but the way they handle it is so different I don't know how to do it myself. I am making a mod that require adding new ore in the map and well its the major thing blocking me from making my mod ^^'

I'd like to know if someone has a solution for me so I can release my first mod! :D

Re: How do you add new ore generation

Posted: Thu Mar 24, 2016 6:31 am
by zurisar
For my mod I did that things for add new ores:

autoplace-controls.lua

Code: Select all

{
    type = "autoplace-control",
    name = "tin-ore",
    richness = true,
    order = "b-f"
  },
noise-layers.lua

Code: Select all

{
		type = "noise-layer",
		name = "tin-ore"
	},
items/ores.lua

Code: Select all

{
		type = "item",
		name = "tin-ore",
		icon = "__base__/graphics/icons/copper-ore.png",
		flags = {"goes-to-main-inventory"},
		subgroup = "raw-resource",
		order = "g[tin-ore]",
		stack_size = 200
	},

entities/resources.lua

Code: Select all

{
    type = "resource",
    name = "tin-ore",
    icon = "__base__/graphics/icons/copper-ore.png",
    flags = {"placeable-neutral"},
    order="a-b-e",
    minable =
    {
      hardness = 0.9,
      mining_particle = "copper-ore-particle",
      mining_time = 2,
      result = "tin-ore"
    },
    collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace =
    {
      control = "tin-ore",
      sharpness = 1,
      richness_multiplier = 13000,
      richness_base = 350,
      size_control_multiplier = 0.06,
      peaks = {
        {
          influence = 0.2,
          starting_area_weight_optimal = 0,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.65,
          noise_layer = "tin-ore",
          noise_octaves_difference = -1.9,
          noise_persistence = 0.3,
          starting_area_weight_optimal = 0,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.3,
          starting_area_weight_optimal = 1,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.55,
          noise_layer = "tin-ore",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.4,
          starting_area_weight_optimal = 1,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "iron-ore",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.45,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "coal",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.45,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "stone",
          noise_octaves_difference = -3,
          noise_persistence = 0.45,
        },
      },
    },
    stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
    stages =
    {
      sheet =
      {
        filename = "__base__/graphics/entity/copper-ore/copper-ore.png",
        priority = "extra-high",
        width = 38,
        height = 38,
        frame_count = 4,
        variation_count = 8
      }
    },
    map_color = {r=0.215, g=0.215, b=0.215}
  },
So u need basic ore item, resource entity, noise-level and autoplace-control for settings when you start new game
Settings for spawning in entity section, good luck!

Re: How do you add new ore generation

Posted: Thu Mar 24, 2016 8:16 am
by Solar's Wrath
Thanks!! I'll try that :D

Edit: I can name items/ores.lua the way I want? same for entities/resources.lua?