Uh oh!
There was an error while loading. Please reload this page.
Allow disabling the seeder unit of cultivators with a seeder configuration (#989) - #1285
Conversation
The Horsch Finer 6 SL, Väderstad TopDown 600 and Dalbo Powerchain 800 gained a seeder unit configuration (vehicle type cultivatingSowingMachine) with game patch 1.8. Their sowing machine spec needs activation, so getAIRequiresTurnOn() returns true and Courseplay hid the optional sowing setting for them. The seeder unit was always turned on by the base game AI and could not be disabled, even when the user only wanted to cultivate (Courseplay#989). Three changes: 1. The optional sowing setting is now also visible for implements that have both the SowingMachine and the Cultivator specialization. 2. While a CP job is running and sowing is disabled by the user, TurnOnVehicle.getAIRequiresTurnOn() returns false for these implements. Without this, TurnOnVehicle:getCanAIImplementContinueWork() fails for machines that require turning on but are turned off, so the driver would lower the implement and then stand still forever. The override intentionally checks the specializations directly instead of the setting's getIsDisabled(), as that would recurse back into getAIRequiresTurnOn() via isOptionalSowingMachineSettingVisible(). 3. needsRefilling() no longer asks for seeds when sowing is disabled or when the seed fill unit has capacity 0. Machines like the Finer 6 SL seeder unit have no real seed tank (capacity 0 means they can always consume, see SowingMachine:getSowingMachineCanConsume) and could never be refilled, so CP kept waiting for a refill that can't happen. FixesCourseplay#989
pvaiko
left a comment
There was a problem hiding this comment.
I'm not very familiar with this part of the CP code, but I'm not sure this is the right approach. I'd need some more detailed explanation why the current setting does not work, what makes this new machines different than the existing ones.
| --- Sowing was disabled by the user, so no seeds are needed (#989). | ||
| return false | ||
| end | ||
| if self.implement:getFillUnitCapacity(self.sowingMachineSpec.fillUnitIndex) == 0 then |
There was a problem hiding this comment.
I am not very familiar with this part of the CP code but I have the gut feeling that this here is either not necessary or incorrect, and should be handled by the implement controller.
pvaiko
commented
Jul 5, 2026
Also, not sure that the "Testing" section in the description means, is that what was actually tested or what the AI thinks should be tested. Anyway, what is missing there is regression testing. |
Problem
Fixes#989.
The Horsch Finer 6 SL, Väderstad TopDown 600 and Dalbo Powerchain 800 gained a seeder unit configuration (vehicle type
cultivatingSowingMachine) with game patch 1.8. Their sowing machine spec hasneedsActivation="true", sogetAIRequiresTurnOn()returnstrueand Courseplay hides the optional sowing setting for them. As a result the seeder unit is always turned on by the base game AI and cannot be disabled, even when the user only wants to cultivate.Changes
CpVehicleSettings: the optional sowing setting (optionalSowingMachineEnabled) is now also visible for implements that have both theSowingMachineand theCultivatorspecialization, not only for passive sowing machines that don't require turning on.isOptionalSowingMachineSettingDisabled()mirrors the visibility check.SowingMachineController: while a CP job is running and sowing is disabled by the user, an override ofTurnOnVehicle.getAIRequiresTurnOn()returnsfalsefor these implements. Without this,TurnOnVehicle:getCanAIImplementContinueWork()fails for machines that require turning on but are turned off, so the driver lowers the implement and then stands still forever, waiting inWAITING_FOR_LOWER.getIsDisabled(): that would callisOptionalSowingMachineSettingVisible(), which itself callsgetAIRequiresTurnOn(), resulting in an infinite recursion (stack overflow every update loop).SowingMachineController:needsRefilling(): no seeds are requested when sowing is disabled, or when the seed fill unit has capacity 0. The Finer 6 SL seeder unit has no real seed tank (capacity="0", which perSowingMachine:getSowingMachineCanConsume()means it can always consume) — CP treated it as permanently empty and kept waiting for a refill that can never happen ("tank is empty" stop when sowing was enabled).Behavior
Cultivatorspecialization the setting stays hidden/disabled andgetAIRequiresTurnOn()falls through to the original implementation.Testing
Tested in SP on game version 1.10 with the Horsch Finer 6 SL (seeder unit configuration):