braeven / FS22_A_ProductionRevamp

http://discord.gg/gHmnFZAypk
28 stars 3 forks source link

Need help with New feature of mod #8

Closed MadSochi closed 1 year ago

MadSochi commented 1 year ago

Please share with me the code lines and tell me which file i need to edit and where i must to paste this lines for resolving this problem:

Need to fully disable for players that functions: ProductionPoint.OUTPUT_MODE.DIRECT_SELL and ProductionPoint.OUTPUT_MODE.AUTO_DELIVER

maybe i just need to COMMENT some lines in some file in the mod archive. Please tell me which one and where.

I've changed lines in the revamp.lua from

xmlFile:iterate(key .. ".directSellFillType", function (index, directSellKey)
        local fillType = g_fillTypeManager:getFillTypeIndexByName(xmlFile:getValue(directSellKey))

        if fillType then
            self:setOutputDistributionMode(fillType, ProductionPoint.OUTPUT_MODE.DIRECT_SELL)
        end
    end)

to

xmlFile:iterate(key .. ".directSellFillType", function (index, directSellKey)
        local fillType = g_fillTypeManager:getFillTypeIndexByName(xmlFile:getValue(directSellKey))

        if fillType then
            self:setOutputDistributionMode(fillType, ProductionPoint.OUTPUT_MODE.STORE)
        end
    end)

But it not helped. In the game still appear 4 different output tipes when i pressed "Change output mode" button.

P.S. Changed to

xmlFile:iterate(key .. ".storageFillType", function (index, storageKey)
        local fillType = g_fillTypeManager:getFillTypeIndexByName(xmlFile:getValue(storageKey))

        if fillType then
            self:setOutputDistributionMode(fillType, ProductionPoint.OUTPUT_MODE.STORE)
        end
    end)

Still not helped at all... I am not a programmer. Just a man with a simple english language knowledge. So i need help by professionals.

braeven commented 1 year ago

There is a function for that already in revamp, but you need to edit the .xml files of every production:

<productions>
  <production id="cereal" name="$l10n_fillType_cereal" cyclesPerHour="100" costsPerActiveHour="5">
    <inputs>
      <input fillType="OAT" amount="5"/>
    </inputs>
    <outputs>
      <output fillType="CEREAL" amount="55" disableDirectSell="true" disableDistribution="true" />
    </outputs>
  </production>
</productions>

after you edited all productions like this, you still need to change the delivery mode of every production already placed before the change, as this change will not change already set modes, but will prevent them from using this modes again