Remove ore offset randomization

Place to get help with not working mods / modding interface.
pfg
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Sep 21, 2016 9:57 pm
Contact:

Remove ore offset randomization

Post by pfg »

I currently am making a mod that adds sand, a mineable resource on the ground. This works fine, except the sand texture gets randomized in its placement on the ground, making it not tile. Is there any way to fix this?

Images

Code: Select all

local function autoplace_settings(name, coverage)
  local ret = {
    control = name,
    sharpness = 1,
    richness_multiplier = 1500,
    richness_multiplier_distance_bonus = 20,
    richness_base = 500,
    coverage = coverage,
    peaks = {
      {
        noise_layer = name,
        noise_octaves_difference = -1.5,
        noise_persistence = 0.3,
      },
    }
  }
  for i, resource in ipairs({ "sand-ore" }) do
    if resource ~= name then
      ret.starting_area_size = 600 * coverage
      ret.starting_area_amount = 1500
    end
  end
  return ret
end

data:extend({
  {
    type = "noise-layer",
    name = "sand-ore"
  }
})

data:extend({
  {
    type = "autoplace-control",
    name = "sand-ore",
    richness = true,
    order = "g-s"
  }
})

data:extend({
  {
    type = "resource",
    name = "sand-ore",
    icon = "__liquid-science__/graphics/icons/resource/sand-ore.png",
    flags = {"placeable-neutral"},
    order="a-b-a",
    minable =
    {
      hardness = 0.9,
      mining_particle = "iron-ore" .. "-particle",
      mining_time = 2,
      result = "sand"
    },
    collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace = autoplace_settings("sand-ore", 0.02),
    stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
    stages = {
      sheet = {
        filename = "__liquid-science__/graphics/icons/resource/sand-ore-spritesheet.png",
        priority = "extra-high",
        width = 38,
        height = 38,
        frame_count = 4,
        variation_count = 8
      }
    },
    map_color = {r=0.803, g=0.388, b=0.215}
  }
})

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

Re: Remove ore offset randomization

Post by darkfrei »

Make tile pictures 32x32 seamless.
pfg
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Sep 21, 2016 9:57 pm
Contact:

Re: Remove ore offset randomization

Post by pfg »

darkfrei wrote:Make tile pictures 32x32 seamless.
That made it look even worse:
Image
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Remove ore offset randomization

Post by bobingabout »

I think this is one of those things that will be changed in 0.15. They're moving away from square tiles, to Jigsaws. this requires no randomness, so, it will be removed.

And the basic answer is... you can't in 0.14, the random placement is hard coded into the game for ores.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”