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
12 days ago
0.17 - 2.0
3.32K
Transportation Combat Logistic network Circuit network

b [Fixed] Crash with logi sensor

2 months ago

When placing the logistic network sensor into the vehicle grid it causes this error message.

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

Error while running event autodrive::on_tick (ID 0)
autodrive/scripts/driving.lua:225: attempt to index field 'logistic_point' (a nil value)
stack traceback:
autodrive/scripts/driving.lua:225: in function 'check_crons'
autodrive/scripts/driving.lua:864: in function 'tick_vehicle'
autodrive/scripts/event_handlers.lua:1302: in function <autodrive/scripts/event_handlers.lua:1256>

2 months ago

Thanks for the report! This is a known issue and I'm already working on it. :-)

2 months ago

Should be fixed in version 2.0.3. Can you confirm this?

2 months ago

Yes I can now place the logi network sensor in the cars grid and it doesn't crash. But now the car wont interact with the logistic network, it has filtered slots for ammo and fuel and nothings being requested nor are unfiltered items being removed.

2 months ago

But now the car wont interact with the logistic network, it has filtered slots for ammo and fuel and nothings being requested nor are unfiltered items being removed.

Thanks for reminding me, I should have changed the description! That was the way logistics worked before Factorio 2.0, when vehicle logistics was a revolutionary concept. Before Factorio 2.0, we had to simulate vehicle logistics by setting requests in a hidden requester chest and putting items from unfiltered slots into a hidden provider chest to pretend that bots would interact with the vehicle. Cycling through inventory items, moving items from trunk to hidden chests (and vice versa) – all of that was controlled by script because that was the only way to get logistics working at the time. Of course, this was expensive in terms of UPS!

With Factorio 2.0, vehicle logistics are supported by the game IF the vehicle prototype has been defined with trash_inventory_size > 0 AND the force owning the vehicle has enabled the vehicle_logistics flag. Autodrive makes sure that all supported vehicles have trash_inventory_size, and it will set the vehicle_logistics flag when the logistics sensor has been researched by the force. You can then use the vehicle's native logistics tab to request/trash stuff. (As a reminiscence to the past, the button "Vehicle logistics" at the top of the vehicle's logistic tab will be cleared if the vehicle is moving too fast, or if it is not in range of a logistic network, or if the logistic network in range has no logistic bots available.)

Also, Autodrive-controlled vehicles with a logistics sensor will automatically request ammo, fuel, or repair packs (requires ammo, fuel, or repair sensor) to supply the vehicle. You can set preferred items if you click on the respective button in Autodrive's main GUI.

Sorry for the confusion, I guess I'll need to rework the info page! :-)

New response