Courseplay / Courseplay_FS22

Courseplay for Farming Simulator 2022
GNU General Public License v3.0
819 stars 172 forks source link

[BUG_SP] attempt to perform arithmetic on field 'targetX' (a nil value) #3299

Closed dakotahorstman closed 1 week ago

dakotahorstman commented 2 weeks ago

Related: #3265

Steps to reproduce

  1. Start any Harvester on any field (I have New Holland CH7.70) with CP: Fieldwork
  2. Configure a tractor and trailer to unload combine and deliver to any unload station using Giants Helper (I have an MF 7719 S going to Grain Mill).
  3. Enjoy the freeze and crash.

Actual behavior Things start to break when the AI attempts to path back to the field after unloading: animations freeze, can no longer exit vehicles or move at all, camera stuck in one direction, etc.

Expected behavior Things not to break (the AI being able to drive back to the field).

Courseplay version Version used: 7.4.1.3

Log log.txt

Map Elmcreek

Vehicles/ implements involved Which vehicle or implement? MF 7719 S, any trailer Mod yes/no ? Just Enhanced Animals and Enhanced Loans in addition to Courseplay.

Relevant script mods N/A. Only Courseplay.

Tensuko commented 2 weeks ago

All targets placed? Field and target? Why do you have cp unzipped?

dakotahorstman commented 2 weeks ago

Setting the target fixed the issue. I missed that entirely in the docs. Regardless, a simple mistake like that should be handled better. Locking up the entire game should absolutely not happen -- a simple warning would be preferable (I don't mod, so I don't know how possible that is).

As for why unzipped: I could not get FS22 to list CP, or any mod, when loading in my save files or starting a new one. Not sure why, but it found them when I unzipped them.

Tensuko commented 2 weeks ago

Locking up the entire game should absolutely not happen -- a simple warning would be preferable (I don't mod, so I don't know how possible that is).

Thats totaly right. But now we know why this happens and stuff, but I wonder why the bug is still there.

As for why unzipped...

Thats strange. But if you load from modhub, everything works?

Tensuko commented 2 weeks ago

How do you manage to not have the target position set? When I use the HUD and click on "no course" i get right into the AI Menu and the target is set automatically. The same does happen when I go over the AI Menu and use "create job", select CP: Fieldwork, place only the field marker and open the generator, the target maker is also set automatically.

This situation should never happen. Even when I place the target far away.

dakotahorstman commented 1 week ago

Thats strange. But if you load from modhub, everything works?

I installed via downloading the zip from releases here on GitHub, not modhub.

How do you manage to not have the target position set? When I use the HUD and click on "no course" i get right into the AI Menu and the target is set automatically. The same does happen when I go over the AI Menu and use "create job", select CP: Fieldwork, place only the field marker and open the generator, the target maker is also set automatically.

This situation should never happen. Even when I place the target far away.

That is a great question. Perhaps its an issue specifically with controller as that's what I use (xbox controller) to play with, instead of keyboard and mouse.

(I don't have the game open as I write this, so please excuse any inaccuracies)

If I recall correctly, the target is also set when I set the field, hence why I didn't do it. I can let you know more tomorrow or later tonight.