Autodrive

by Pi-C

Car equipment for train avoidance, logistic network integration, circuit network connectivity, fuel refill, ammo reload, vehicle repair, radio control, enemy targeting, and gate control.

Content
a month ago
0.17 - 2.0
3.27K
Transportation Combat Logistic network Circuit network

g Hard Crash

16 days ago
(updated 16 days ago)

I just had a crash out of the blue. I reloaded with only AD but it still crashes while loading my save. Here is the message:


The mod Autodrive (2.0.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event autodrive::on_configuration_changed
Pi-C_lib/libs/assertions.lua:279: Wrong argument! nil is not a valid sensor name or nil!
stack traceback:
[C]: in function 'error'
Pi-C_lib/libs/assertions.lua:279: in function 'arg_err'
Pi-C_lib/libs/assertions.lua:362: in function 'assert'
autodrive/scripts/gui_stuff/gui_vehicles_sensors.lua:2330: in function 'close_gui'
autodrive/scripts/gui_stuff/gui_vehicles.lua:437: in function 'set_elements_enabled_state'
autodrive/scripts/gui_stuff/gui_vehicles.lua:875: in function 'adjust_enabled_states'
autodrive/scripts/gui_stuff/gui_vehicles.lua:1817: in function 'update_vehicle_entry'
autodrive/scripts/gui_stuff/gui_vehicles.lua:1883: in function 'update_gui'
autodrive/scripts/gui_stuff/gui_vehicles.lua:1008: in function 'init_gui'
autodrive/scripts/gui.lua:941: in function 'initialize_guis'
autodrive/scripts/players.lua:830: in function 'init_player'
autodrive/scripts/event_handlers.lua:1154: in function 'on_configuration_changed'
autodrive/control.lua:401: in function <autodrive/control.lua:399>


Here is my save and mod folder files:

https://drive.google.com/file/d/13K8S_YomZHZWHxzk4bzJySdBelvDPLuy/view?usp=sharing
https://drive.google.com/file/d/1ldKYKWMTYOvNR5tFnVAH-ijvkj4NBd8p/view?usp=sharing
https://drive.google.com/file/d/1915vDAA5mt0Erk1peqZ3PKB6ZQZBT3Lu/view?usp=sharing

As my twitch skills are receding faster than my hairline, AD is one of my must-haves that keeps me from wrecking my base or getting stranded in the middle of nowhere because I ran into a tree. PLEASE tell me that there is an easy fix.

Thank you for this most excellent mod.

16 days ago

Thanks for the report! The actual error seems to occur in Pi-C_lib: Wrong argument! nil is not a valid sensor name or nil! makes no sense because nil should be an accepted value. I've updated my WIP version of the lib mod while working on AD/GCKI. Not quite sure whether I remember this correctly, but I may already have fixed this for the next update. I'll check when I get back home.

As my twitch skills are receding faster than my hairline, ...

Nicely phrased! :-)

Thank you for this most excellent mod.

Thanks for the compliment, glad you like it!

16 days ago

Thank you for investigating it so promptly. I took a look at the Factorio changelog (https://wiki.factorio.com/Version_history/2.0.0) and it shows an update happened recently. I wonder if that changed something which caused the crash. (I often leave Factorio running in the background for days at a time, as it is so light-weight that, when paused, I can play other games at the same time without noticing anything.)

9 days ago

I've finally got to testing your saved game, and the game crashed at the same place as in your error message. However, I've got a slightly different error message. Instead of

Wrong argument! nil is not a valid sensor name or nil!

I've got

Wrong argument! false is not a valid sensor name or nil!

The different values (nil vs. false) are baffling – did you perhaps make a mistake while writing the error message (assuming you didn't copy'n'paste it)? Anyway, I've fixed my crash by changing line 373 of file scripts/gui_stuff/gui_vehicles.lua from

      sensor_gui_for_vehicle = s_prefs and (s_prefs.id == id) and s_name

to

      sensor_gui_for_vehicle = s_prefs and (s_prefs.id == id) and s_name or nil

Does that work for you as well?

2 days ago

I've finally got to testing your saved game, and the game crashed at the same place as in your error message. However, I've got a slightly different error message. Instead of

Wrong argument! nil is not a valid sensor name or nil!

I've got

Wrong argument! false is not a valid sensor name or nil!

The different values (nil vs. false) are baffling – did you perhaps make a mistake while writing the error message (assuming you didn't copy'n'paste it)? Anyway, I've fixed my crash by changing line 373 of file scripts/gui_stuff/gui_vehicles.lua from

      sensor_gui_for_vehicle = s_prefs and (s_prefs.id == id) and s_name

to

      sensor_gui_for_vehicle = s_prefs and (s_prefs.id == id) and s_name or nil

Does that work for you as well?

I've had a very similar crash happening, same error but I'm not sure how to reproduce it, has something to do with selecting several vehicles and switching between them in the UI. At any rate, this edit fixed crash.

New response