Potatosorter v2.0.0.0 - Unable to sell Premium Potato at selling stations

User avatar
Decker_MMIV
Posts: 287
Joined: Wed Aug 22, 2012 1:02 am

Potatosorter v2.0.0.0 - Unable to sell Premium Potato at selling stations

Post by Decker_MMIV »

Have updated to the v2.0.0.0 of 'GlobalCompany - PotatoSorter'
https://www.farming-simulator.com/mod.p ... tle=fs2019

But now it is not possible to sell premium potatoes (POTATOSORTED), as sell-stations wont accept this product.

To reproduce:
- Start a new game, default map - I used RavenPort.
- Deactivate all mods, and then activate only the mods; GlobalCompany v1.7.1.0, PotatoWasher v1.0.0.0 & PotatoSorter v2.0.0.0.
- Notice that the sell-stations will not accept 'Premium Potato'.

Technical:
The problem seems to be, that the overloaded SellingStation.load method is returning the value nil - which could indicate that the not-documented SellingStation.load method is not returning a value.

This may again be caused by the other required mod; PotatoWasher v1.0.0.0, as it appends to the SellingStation.load method, where that method does not return a value (i.e. the result will be nil).

So I wonder if there is a newer PotatoWasher mod, with updated LUA script that works in conjunction with the PotatoSorter v2.0.0.0?
buck2202
Posts: 5
Joined: Tue Sep 15, 2020 10:58 pm

Re: Potatosorter v2.0.0.0 - Unable to sell Premium Potato at selling stations

Post by buck2202 »

You can make these changes to the sorter. From

Code: Select all

if not superFunc(object, ...) then
    return false
end
to

Code: Select all

local returnVal = superFunc(object, ...)
and from

Code: Select all

return true
to

Code: Select all

return returnVal
in the overload function of FS19_GlobalCompanyPlaceable_Sorter.zip/addtosellingstation.lua (or adapt the potato washer to follow the new technique of the sorter, just swapping potato types in its logic).

For what it's worth, the Firewood mod also uses this technique for adding to selling stations, and it's also broken by the potato washer (and possibly other mods). I think the firewood/new sorter method is probably a bit fragile, but making it non-conditional should be more robust.

edit: and just to recap some debugging
  • if you enable base Global Company, the new sorter, and not the washer, premium potatoes are accepted where they're supposed to be. (Firewood also works)
  • Simply adding a return true statement in the potato washer doesn't fix the issue
User avatar
Decker_MMIV
Posts: 287
Joined: Wed Aug 22, 2012 1:02 am

Re: Potatosorter v2.0.0.0 - Unable to sell Premium Potato at selling stations

Post by Decker_MMIV »

buck2202 wrote: Wed Oct 27, 2021 11:25 pm [..] or adapt the potato washer to follow the new technique of the sorter, just swapping potato types in its logic
I did that, as I only use it in singleplayer, while waiting for no.naim & DerElky to release an newer version of their PotatoWasher.

And I was wrong about the "no documentation" of the SellingStation.load method. As it is stated on the SellingStation's documentation, it inherits from UnloadingStation, where the load method is clearly visible ... though it apparently only has one execution-path that will always return the value true :confusednew:
Post Reply