Page 1 of 1

Updating my mod and a lot of errors i can't handle

Posted: Sat Apr 20, 2019 10:03 am
by Grundox
So I am trying to update my mod rn from 0.16 to 0.17 and realised that a lot of things have changed and I am having a ton of trouble with the updated/removed autoplace control.
this is the old code I used to generate ore fields

Code: Select all

   {
   type = "autoplace-control",
   name = "agate",
   richness = true,
   order = "b-e"
   },
   {
   type = "noise-layer",
   name = "agate"
   },
   {
   type = "resource",
   name = "agate",
   icon = "__grundoxores__/graphics/icons/ores/agate.png",
   flags = {"placeable-neutral"},
   order="a-b-a",
   map_color = {r=0.5, g=0, b=0},
   minable =
   {
     hardness = 1,
     mining_particle = "agate-particle",
     mining_time = 1.5,
     result = "agate"
   },
   collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
   selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
   autoplace =
   {
      control = "agate",
      sharpness = 1,
      richness_multiplier = 5000,
      richness_multiplier_distance_bonus = 200,
      richness_base = 2000,
      coverage = 0.01,
      peaks = {
         {
            noise_layer = "agate",
            noise_octaves_difference = -1.5,
            noise_persistence = 0.3,
            starting_area_weight_optimal = 0,
            starting_area_weight_range = 0,
            starting_area_weight_max_range = 2,
         },
         {
            noise_layer = "agate",
            noise_octaves_difference = -2,
            noise_persistence = 0.3,
            starting_area_weight_optimal = 1,
            starting_area_weight_range = 0,
            starting_area_weight_max_range = 2,
         },
         {
            influence = 0.15,
            starting_area_weight_optimal = 1,
            starting_area_weight_range = 0,
            starting_area_weight_max_range = 2,
         }
      }
   },
    stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
   stages =
   {
     sheet =
     {
      filename = "__grundoxores__/graphics/entity/ores/iron-ore.png",
      priority = "extra-high",
      tint = {r=0.5, g=0, b=0},
        width = 64,
        height = 64,
        frame_count = 8,
        variation_count = 8
     }
   },
  },
now that this doesn't work anymore I tried to copy paste the code for uranium ore and deleted some lines like the glowing effects and the fluid requirements and I get a like 500 lines long error code notice

Code: Select all

data:extend(
{
{
  {
    type = "resource",
    name = "agate",
    icon = "__base__/graphics/icons/agate.png",
    icon_size = 32,
    flags = {"placeable-neutral"},
    order="a-b-a",
    tree_removal_probability = 0.9,
    tree_removal_max_distance = 32 * 32,
    minable =
    {
      mining_particle = "agate-particle",
      mining_time = 1.5,
      result = "agate"
    },
    collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace = resource_autoplace.resource_autoplace_settings{
      name = "agate",
      order = "c",
      base_density = 0.9,
      base_spots_per_km2 = 1.25,
      has_starting_area_placement = false,
      random_spot_size_minimum = 2,
      random_spot_size_maximum = 4,
      resource_index = resource_autoplace.get_next_resource_index(),
      regular_rq_factor_multiplier = 1
    },
    stage_counts = {10000, 6330, 3670, 1930, 870, 270, 100, 50},
    stages =
    {
      sheet =
      {
        filename = "__grundoxores__/graphics/entity/ores/iron-ore.png",
        priority = "extra-high",
		tint = {r=0.5, g=0, b=0},
        width = 64,
        height = 64,
        frame_count = 8,
        variation_count = 8,
      }
    },
    map_color = {r=0.5, g=0, b=0}
  }
},
})
start and end of the error notice is in attachments
Many Thanks in advance for helping me with this issue, I greatly appreciate any help!
Greetings,
Grundox

Re: Updating my mod and a lot of errors i can't handle

Posted: Sat Apr 20, 2019 11:29 am
by orzelek
If error looks silly - look at brackets. You have one pair of {} to many so it goes crazy trying to parse it.