mod_name = "__IceOre__"
local function autoplace_settings(name, coverage)
local ret = {
control = name,
sharpness = 1,
richness_multiplier = 1500,
richness_multiplier_distance_bonus = 30,
richness_base = 500,
coverage = coverage,
peaks = {
{
noise_layer = name,
noise_octaves_difference = -1.5,
noise_persistence = 0.3,
},
}
}
for i, resource in ipairs({"ice-ore"}) do
if resource ~= name then
ret.starting_area_size = 600 * coverage
ret.starting_area_amount = 1500
end
end
return ret
end
local function resource(name, map_color, hardness, coverage)
if hardness == nil then hardness = 0.9 end
if coverage == nil then coverage = 0.02 end
return {
type = "resource",
name = name,
icon = mod_name.."/graphics/icons/" .. name .. ".png",
icon_size = 32,
flags = {"placeable-neutral"},
order="a-b-a",
minable =
{
hardness = hardness,
--mining_particle = name .. "-particle",
mining_time = 2,
result = name
},
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace = autoplace_settings(name, coverage),
stage_counts = {5000, 3000, 1500, 800, 400, 100, 50, 10},
stages =
{
sheet =
{
filename = mod_name.."/graphics/entity/" .. name .. ".png",
priority = "extra-high",
width = 64,
height = 64,
frame_count = 8,
variation_count = 8,
hr_version =
{
filename = mod_name.."/graphics/entity/" .. "hr-" .. name .. ".png",
priority = "extra-high",
width = 128,
height = 128,
frame_count = 8,
variation_count = 8,
scale = 0.5
}
}
},
map_color = map_color
}
end
data:extend(
{
resource("ice-ore", {r=0.9, g=0.9, b=1})
}
)
data:extend(
{
{
type = "autoplace-control",
name = "ice-ore",
richness = true,
order = "b-h",
category = "resource"
}
}
)
Re: New Ores
Posted: Fri Mar 09, 2018 9:16 am
by bobingabout
Bob Library on the portal does offer an easier way to add ores.
Bob ores will give you a demonstration on how to use it.
However
you need a resource (look at prototype/resources.lua), a noise layer, an autoplace control(can't remember what file they're in, but should be easy enough to find), and also an item for whatever result is on the resource
Re: New Ores
Posted: Fri Mar 09, 2018 1:55 pm
by DiegoPro77
Thanks for your suggestions guys, i will see these mods.
For the ore patch i've inspired from both the mods and now i can create all the ore patches that i want
For the purifying machine i've inspired from your "bobassembly" mod Bobingabout (you're very good with programming lua files and your work is very, very easy to understand compared to some mods!) and this is the first entity i've ever done.
I'm sorry if i haven't ask you if i could've use your mod for inspiring me (and sorry for my English ).
Re: New Ores
Posted: Mon Mar 12, 2018 9:17 am
by bobingabout
Inspiration is free, in fact in my licence it states that I encourage it, as long as no assets are used directly from my mod. (no copy pasting large chunks of code such as functions I've written, or art assets without asking me first)
I see you used my assembling machine mask overlay. Honestly though, since that was just a crop greyscale and brighten of part of the original assembling machine 3, I have no issues with you using it.
Anyway, I'm glad you got your mod working as intended
Re: New Ores
Posted: Mon Mar 19, 2018 12:25 pm
by firestar246
darkfrei wrote:
DiegoPro77 wrote:Can someone tell me how to create a new ore like iron or copper? (ex. it spawns in the starting area but not only there.)
So I made some ores in my mod based of off your Ice Ore mod, but I'm running into a problem. The ores aren't displaying properly in the world. You know how all the sprites (or whatever they're called) for the ore are on one graphic, and the game somehow seems to take just one of them when placing the ore... well my game is taking the wrong chunks off of the graphic, so instead of showing one ore, it's taken parts of two or more. So my ores look all choppy and weird. They work fine and everything, its just the graphics are really weird. Not sure how to fix this... does anyone have an idea of what's going on?
Re: New Ores
Posted: Mon Mar 19, 2018 12:34 pm
by darkfrei
firestar246 wrote:so instead of showing one ore, it's taken parts of two or more. So my ores look all choppy and weird. They work fine and everything, its just the graphics are really weird. Not sure how to fix this... does anyone have an idea of what's going on?
Can you take a screenshot what you have and make the picture how it must be?
Re: New Ores
Posted: Mon Mar 19, 2018 1:21 pm
by firestar246
darkfrei wrote:
firestar246 wrote:so instead of showing one ore, it's taken parts of two or more. So my ores look all choppy and weird. They work fine and everything, its just the graphics are really weird. Not sure how to fix this... does anyone have an idea of what's going on?
Can you take a screenshot what you have and make the picture how it must be?
I'm trying to upload a screenshot as an attachment, but whenever I click "preview" or "submit" the page just keeps loading and never publishes the post.
Re: New Ores
Posted: Mon Mar 19, 2018 2:07 pm
by Deadlock989
firestar246 wrote:So I made some ores in my mod based of off your Ice Ore mod, but I'm running into a problem. The ores aren't displaying properly in the world. You know how all the sprites (or whatever they're called) for the ore are on one graphic, and the game somehow seems to take just one of them when placing the ore... well my game is taking the wrong chunks off of the graphic, so instead of showing one ore, it's taken parts of two or more. So my ores look all choppy and weird. They work fine and everything, its just the graphics are really weird. Not sure how to fix this... does anyone have an idea of what's going on?
You're probably using the high resolution sprite sheet in normal res or vice versa.
Re: New Ores
Posted: Tue Jun 12, 2018 4:31 am
by aeropar
bobingabout wrote:Bob Library on the portal does offer an easier way to add ores.
Bob ores will give you a demonstration on how to use it.
However
you need a resource (look at prototype/resources.lua), a noise layer, an autoplace control(can't remember what file they're in, but should be easy enough to find), and also an item for whatever result is on the resource
bobingabout wrote:Bob Library on the portal does offer an easier way to add ores.
Bob ores will give you a demonstration on how to use it.
However
you need a resource (look at prototype/resources.lua), a noise layer, an autoplace control(can't remember what file they're in, but should be easy enough to find), and also an item for whatever result is on the resource