Hi there,
so I've started with looking for mods that change the industry and basically learn how can I change cargo types (supply/demand) in lua files.
One thing I found in townbuildingutil.lua is that you can actually make residential building require some cargo but you cannot make town/building produce anything (i.e. custom cargo type: WASTE):
please bare in mind I have both MILK and WASTE defined correctly as I can use them as a resource in industry, etc.
Code
if (townBuildingParams.landUseType == "RESIDENTIAL") then
local ruleCapacity = math.floor(params.capacity / 4 + 0.5)
if (ruleCapacity > 0) then
result.stocks = { }
result.stockRules = { }
local cargoTypes = townBuildingParams.landUseType == "RESIDENTIAL" and { "MILK", "WASTE" }
local inputs = { { { 1, 0 } }, { { 0, 0 } } }
local outputs = { { { 0, 0 } }, { { 0, 1 } } }
local types = { "RECEIVING", "SENDING" }
for i = 1, 2 do
result.stocks[i] = {
cargoType = cargoTypes[i],
type = types[i],
edges = { },
moreCapacity = ruleCapacity
}
result.stockRules[i] = {
input = inputs[i],
output = outputs[i],
capacity = math.floor(ruleCapacity / 4 + 0.5)
}
end
end
end
Alles anzeigen
I guess the cities/buildings are hard-coded that way ?