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 - 1.1
2.97K
Transportation Combat Logistic network Circuit network

b [Fixed?] Just Got This Error

3 months ago

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

Error while running event autodrive::on_player_placed_equipment (ID 40)
autodrive/scripts/event_handlers.lua:1297: attempt to index local 'grid_data' (a nil value)
stack traceback:
autodrive/scripts/event_handlers.lua:1297: in function <autodrive/scripts/event_handlers.lua:1245>

3 months ago

Thanks for the report! Could you provide a saved game where I can reproduce the crash, please? I'd like to find out why there are no grid_data.

3 months ago
(updated 3 months ago)

Don't know how to share save game files, but I can give you the mod that's causing the problem. https://mods.factorio.com/mod/EquipmentPlusPortableEngine

3 months ago

Don't know how to share save game files,

Could you upload it somewhere where I can fetch it without having to log in/register? You also could try to send me a private message on the forum with the file attached.

but I can give you the mod that's causing the problem. https://mods.factorio.com/mod/EquipmentPlusPortableEngine

That's not really helpful: Grid data should be stored whenever a vehicle is placed. For the current version (1.1.15), I've added a migration script where the table with grid data is deleted and rebuilt for all vehicles that are found -- which has worked without problems in my local tests. But your error indicates that there are no grid data for a certain vehicle although this should be impossible.

In order to fix the crash, I must be able to see how you've got into that state. A saved game would be a good start because I can see the list of all mods you use (sometimes mods interfere with each other in mysterious ways) and get some additional information: Did you already use Autodrive in your game, or did you add version 1.1.15 to a running game? Did the vehicle that caused the crash exist before, or did you place it after updating to 1.1.15? Did you update/add/remove any other mods?

3 months ago

Sorry to say but I cant send you a private message I have never used the Factorio forum before so I made an account, but it seems new accounts aren't permitted to use the feature unless they have been active in discussions.

I at the very least can tell you how the error happened. I was in a new free play world with 3 mods active, wanted to test and see if the engine could be used in the car.

Creative mod - https://mods.factorio.com/mod/creative-mod
Portable Engines - https://mods.factorio.com/mod/EquipmentPlusPortableEngine
and Autodrive

I was trying to put the portable engine in a car only to realize that the grid is to small for it, so I tried putting it in power armor upon placing it the error occurred.

3 months ago

it seems new accounts aren't permitted to use the feature unless they have been active in discussions.

Yes, some protection against users getting spammed with messages from newly created accounts. Your first post on the forum must be approved by a moderator, after that you can send private messages.

I was trying to put the portable engine in a car only to realize that the grid is to small for it, so I tried putting it in power armor upon placing it the error occurred.

OK, that was the clue! I completely forgot that other entities could have an equipment grid as well. There actually was a safeguard in version 1.1.14, but for some reason I've commented it out in the last version. As a quick fix, unpack the mod, uncomment the following lines (should be 1274-1278, function common_events.on_player_placed_equipment) in scripts/event_handlers.lua, and restart the game (so that the unpacked version of Autodrive will be used):

  --~ -- Do nothing if the grid belongs to an entity that isn't a vehicle we control
  --~ if not state then
    --~ AD.entered_event({}, "leave", "we don't control "..AD.argprint(vehicle))
    --~ return
  --~ end

(Remove '--~' from the start of each line!)

3 months ago

Thank you very much for the help.

a month ago

Please try version 1.1.16!

New response