Page 1 of 1

Remove ore offset randomization

Posted: Fri Feb 24, 2017 5:10 am
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}
  }
})


Re: Remove ore offset randomization

Posted: Fri Feb 24, 2017 6:28 am
by darkfrei
Make tile pictures 32x32 seamless.

Re: Remove ore offset randomization

Posted: Fri Feb 24, 2017 3:58 pm
by pfg
darkfrei wrote:Make tile pictures 32x32 seamless.
That made it look even worse:
Image

Re: Remove ore offset randomization

Posted: Mon Feb 27, 2017 9:10 am
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.