Hello,
maybe someone can quickly answer this question...
I want to make residential buildings send and receive stocks.. receive mail, send unsorted_mail and waste...
Is it possible? It does not seem to work or something is wrong in my code..
Hallo,
vielleicht kann diese Frage jemand schnell beantworten...
Ich möchte Wohngebäude dazu bringen, waren zu empfangen und zu senden.. Post empfangen, unsortierte Post und Müll senden.
Ist das möglich? Es scheint nicht zu gehen oder ich habe noch einen Fehler im Code
snippet of the code / Auszug aus dem Script:
Lua: townbuildingutil.lua
if townBuildingParams.landUseType == "RESIDENTIAL" then
local ruleCapacity = math.floor(params.capacity / 4 + 0.5)
local outputCapacity = math.floor(params.capacity / 2 + 0.5)
if (ruleCapacity > 0) then
local mailIn = math.floor((params.capacity + 0.5) * 1.5)
local mailOut = math.floor(mailIn * 1.5)
local CargoList = {
"MAIL",
}
result.stocks = { }
result.stockRules = { }
result.stocks[#result.stocks + 1 ] = {
cargoType = "MAIL",
type = "RECEIVING",
edges = { },
moreCapacity = mailIn
}
result.stockRules[#result.stockRules + 1 ] = {
input = { { 1, 0, 0 } },
output = { { 0, 0, 0 } },
capacity = mailIn
}
result.stocks[#result.stocks + 1 ] = {
cargoType = "WASTE",
type = "SENDING",
edges = { },
moreCapacity = outputCapacity
}
result.stockRules[#result.stockRules + 1 ] = {
input = { { 0, 0, 0 } },
output = { { 0, 1, 0 } },
capacity = outputCapacity
}
result.stocks[#result.stocks + 1 ] = {
cargoType = "UNSORTED_MAIL",
type = "SENDING",
edges = { },
moreCapacity = mailOut
}
result.stockRules[#result.stockRules + 1 ] = {
input = { { 0, 0, 0 } },
output = { { 0, 0, 1 } },
capacity = mailOut
}
end
end
Alles anzeigen