Pavement Drive Assist

by Arcitos

Introduces a driver assistance system that autonomously follows paved roads, while maintaining a preset cruise speed if desired.

Utilities
4 years ago
0.14 - 0.18
185

b AAI-programmable-vehicles & PavementDriveAssist Crash

6 years ago

crash on changing AI state in AAI-programmable vehicles, triggered when/if pavementDriveAssist loaded with aai-programable vehicles.
Driving car, toggled state between red/blue/green can cause crash:

"Error while running event aai-programmable-vehicles::on_tick(ID 0)
Error while running event PavementDriveAssist::on_player_driving_changed_State (ID 26)
PavementDriveAssist/pda.lua:90:attempt to index a nil value
stack traceback: aai-programmable-vehicles/control.lua:862: in function'unit_update_mode'
aai-programmable-vehicles/control.lua:3021:in function 'unit tick'
aai-programmable-vehicles/control.lua:3059:in function <__aai-programmable-vehicles__control.lua:3029>

crash likely due to the way both mods modify vehicle code and automated control.
When user wants to turn on/off vehicle AI while driving, (even if cruise control is off) this can cause a crash.

6 years ago
(updated 6 years ago)

Same issue here. I reported it on the AAI forum as well, and as I expected, have been beckoned to tell here.

https://forums.factorio.com/viewtopic.php?f=190&t=38475&start=640#p357487

6 years ago

Same here, please fix it.

Please please pleaseeeee!!!

6 years ago
(updated 6 years ago)

After a bit of time, and with the help of a friend, we were able to locate the issue. the problem is that there are 2 values that become nil when the AI is turned off with AAI. To solve this issue you must add 2 if statements to pda.lua in Pavement Drive Assist. When in the file go to Line 82 and put these 2 statements below that line:

if player.vehicle ~= nil then
if player.vehicle.get_driver() ~= nil then

DONT FORGET TO ADD THE "end" STATEMENT IN THE CORRECT LOCATION

Notepad++ is excellent free app for viewing code if you are having issues reading it.

I tried to test as many situations as possible to see if any other bugs appeared and I did not find any. My skills for coding are nil so if there are any further issues I will try to figure it out!

New response