trouble creating new prototypes based on fluids in 0.15
Posted: Thu Apr 27, 2017 6:37 am
here's my data-updates.lua from 0.13:
I updated the decorative type to optimized-decorative to get it to run at all. Now I'm running into a problem when I try to create an entity from a prototype such as chemical-spill-lubricant-large which apparently does not exist. I've re-confirmed that data.raw.fluid["lubricant"] exists, so I should still be creating new prototypes based on it. What else might have changed between 0.13 and 0.15 to break this?
Code: Select all
local spill_sizes = {
small =1,
medium=2,
large =3
}
for name, proto in pairs(data.raw.fluid) do
for sizename, size in pairs(spill_sizes) do
data:extend(
{
{
type = "decorative",
name = "chemical-spill-" .. proto.name .. '-' .. sizename,
flags = {"placeable-neutral", "placeable-off-grid", "not-on-map"},
icon = "__wreckage-pollution__/graphics/entity/chemical-spill-" .. sizename .. ".png",
subgroup = "chemical-spill",
order = "d[chemical-spill]-a[" .. proto.name .. "]-a[" .. sizename .. "]",
collision_box = {{-size, -size}, {size, size}},
selection_box = {{-size, -size}, {size, size}},
selectable_in_game = false,
render_layer = "decorative",
pictures =
{
{
filename = "__wreckage-pollution__/graphics/entity/chemical-spill-" .. sizename .. ".png",
width = size * 64,
height = size * 64,
tint = proto.base_color,
}
}
},
}
)
end
end