moin
Ich wollte eine Abnahme industry für schlacke erstellen.
Bin soweit gekommen :
Die Schlacke wird angefordert gelieftert und auch verbraucht aber das auf leveln klappt nicht und es wird auch keine linienbenutzung angezeigt.
Obwohl die Angeliefterte Schlacke verbraucht wird.
Ich habs auf grundlage des Steinbruchs das gebäude erstellt, im code nur den cargoType, den type auf RECEIVING, die stockRules
und die capacity = hab ich bei den höheren stufen erhöt ( bei mir auch bei allen anderen industry ) geändert.
Ich komme leider nicht weiter und wollte jetzt um hilfe fragen.
Code
ocal constructionutil = require "constructionutil"
local paramsutil = require "paramsutil"
local vec3 = require "vec3"
local transf = require "transf"
function data()
return {
type = "INDUSTRY",
description = {
name = _("Quarry"),
},
availability = {
},
soundConfig = {
soundSet = { name = "quarry" },
effects = {
select = {
"selected_industry_quarry1.wav",
"selected_industry_quarry2.wav",
"selected_industry_quarry3.wav"
}
}
},
params = paramsutil.makeIndustryParams(),
updateFn = function(params)
local result = { }
local level = (params.productionLevel or 0) + 1
result.models = { }
result.groundFaces = { }
result.stocks = { }
result.stockRules = { }
--collider
result.models[#result.models + 1] = { id = "asset/industry/collider_rock_9.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 } }
local edges = { }
local terrainFaces = { }
local groundFace = { }
local fenceFace = { }
local edges = { }
edges[#edges + 1] = { { 0.0, -64.0 - 15.0, 0.0 }, { 00.0, 44.0 + 15.0, 0.00 } }
edges[#edges + 1] = { { 0.0, -20.0, 0.0 }, { 00.0, 44.0 + 15.0, 0.00 } }
edges[#edges + 1] = { { 0.0, -20.0, 0.0 }, { -10.0,20.0, 0.00 } }
edges[#edges + 1] = { { -10.0,10.0, 0.0 }, { -10.0,20.0, 0.00 } }
edges[#edges + 1] = { { -10.0,10.0, 0.0 }, { 00.0, 20.0, 0.00 } }
edges[#edges + 1] = { { -10.0,30.0, 0.0 }, { 00.0, 20.0, 0.00 } }
edges[#edges + 1] = { { -10.0,30.0, 0.0 }, { -30.0, 0.0, 0.00 } }
edges[#edges + 1] = { { -40.0,30.0, 0.0 }, { -30.0, 0.0, 0.00 } }
edges[#edges + 1] = { { -40.0,30.0, 0.0 }, { 0.0, -20.0, 0.00 } }
edges[#edges + 1] = { { -40.0,10.0, 0.0 }, { 0.0, -20.0, 0.00 } }
edges[#edges + 1] = { { -40.0,10.0, 0.0 }, { 30.0, 0.0, 0.00 } }
edges[#edges + 1] = { { -10.0,10.0, 0.0 }, { 30.0, 0.0, 0.00 } }
terrainFaces[#terrainFaces + 1] = { {-63, -63, 0}, {63, -63, 0}, {63, 63, 0}, {-63, 63, 0} }
fenceFace = { {-6,-63, 0}, {-63, -63, 0}, {-63, 63, 0}, {63, 63, 0}, {63, -63, 0}, {6, -63, 0}}
result.groundFaces[#result.groundFaces + 1] = { face = fenceFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
result.groundFaces[#result.groundFaces + 1] = { face = constructionutil.reverseFace(fenceFace), modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
if (level >= 1) then
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_old.mdl",
transf = transf.rotZYXTransl(transf.degToRad(0.0, 0.0, 0.0), vec3.new(-30, -10 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_old.mdl",
transf = transf.rotZYXTransl(transf.degToRad(90.0, 0.0, 0.0), vec3.new(-50, -23 , 0))
}
end
if (level == 1) then
constructionutil.makeStocks({
stocks = {
{ cargoType = "SLAG", type = "RECEIVING", x = 32, y = -50, sizex = 4, sizey = 1 },
},
stockRules = {
{ input = { { 1 } }, output = { { 0 } }, capacity = 1600 },
}
}, result)
groundFace = { {-10, -30}, {-10, 0}, {-60, 0}, {-60, -30}, }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_big_01" } } }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
end
if (level >= 2) then
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_old.mdl",
transf = transf.rotZYXTransl(transf.degToRad(90.0, 0.0, 0.0), vec3.new(-52, -37 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_new.mdl",
transf = transf.rotZYXTransl(transf.degToRad(30.0, 0.0, 0.0), vec3.new(30, 5 , 0))
}
end
if (level == 2) then
constructionutil.makeStocks({
stocks = {
{ cargoType = "SLAG", type = "RECEIVING", x = 32, y = -50, sizex = 4, sizey = 1 },
},
stockRules = {
{ input = { { 1 } }, output = { { 0 } }, capacity = 200 },
}
}, result)
groundFace = { {0, -50}, {0, -20}, {40, -20}, {40, 40}, {0, 40}, {0, 0}, {-60, 0}, {-60, -50}, }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_big_01" } } }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
end
if (level >= 3) then
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_new.mdl",
transf = transf.rotZYXTransl(transf.degToRad(110.0, 0.0, 0.0), vec3.new(-20, -45 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/crusher_connector.mdl",
transf = transf.rotZYXTransl(transf.degToRad(30.0, 0.0, 0.0), vec3.new(30, 5, 0))
}
end
if (level == 3) then
constructionutil.makeStocks({
stocks = {
{ cargoType = "SLAG", type = "RECEIVING", x = 32, y = -50, sizex = 4, sizey = 2 },
},
stockRules = {
{ input = { { 1 } }, output = { { 0 } }, capacity = 600 },
}
}, result)
groundFace = { {0, -60}, {0, -30}, {60, -30}, {60, 40}, {0, 40}, {0, 0}, {-60, 0}, {-60, -60}, }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_big_01" } } }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
end
if (level >= 4) then
result.models[#result.models + 1] = {
id = "industry/quarry/crusher_right.mdl",
transf = transf.rotZYXTransl(transf.degToRad(30.0, 0.0, 0.0), vec3.new(30, 5 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/crusher_left.mdl",
transf = transf.rotZYXTransl(transf.degToRad(30.0, 0.0, 0.0), vec3.new(30, 5 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/crusher_connector.mdl",
transf = transf.rotZYXTransl(transf.degToRad(110.0, 0.0, 0.0), vec3.new(-20, -45, 0))
}
end
if (level == 4) then
constructionutil.makeStocks({
stocks = {
{ cargoType = "SLAG", type = "RECEIVING", x = 32, y = -50, sizex = 4, sizey = 2 },
},
stockRules = {
{ input = { { 1 } }, output = { { 0 } }, capacity = 1600 },
}
}, result)
groundFace = { {0, -60}, {0, -30}, {60, -30}, {60, 40}, {0, 40}, {0, 0}, {-60, 0}, {-60, -60}, }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_big_01" } } }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
end
if (level >= 5) then
result.models[#result.models + 1] = {
id = "industry/quarry/quarry_new.mdl",
transf = transf.rotZYXTransl(transf.degToRad(120.0, 0.0, 0.0), vec3.new(35, -10 , 0))
}
result.models[#result.models + 1] = {
id = "industry/quarry/crusher_left.mdl",
transf = transf.rotZYXTransl(transf.degToRad(120.0, 0.0, 0.0), vec3.new(35, -10 , 0))
}
end
if (level == 5) then
constructionutil.makeStocks({
stocks = {
{ cargoType = "STONE", type = "SENDING", x = 32, y = -50, sizex = 5, sizey = 3 },
},
stockRules = {
{ input = { { 0 } }, output = { { 1 } }, capacity = 3000 },
}
}, result)
groundFace = { {0, -60}, {0, -30}, {60, -30}, {60, 40}, {0, 40}, {0, 0}, {-60, 0}, {-60, -60}, }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_big_01" } } }
result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } }
--fenceFace = { {-6,-63,0}, {-63, -63, 0}, {-63, 63 ,0}, {63, 63, 0}, { 63, -63,0}, {6, -63,0} }
end
Alles anzeigen