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 had this error

2 months ago
(updated 2 months ago)

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

Errior while running event autodrive;;o_player_placed_equipment (ID 40) _ autodrive /scripts/event_handlers.lua:1279: 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>

Note: I had tried the fix on the issue from a similar post but it seem not to be working for me

2 months ago

Thanks for the report! This bug is a bit strange because if you could place equipment in a vehicle grid, you must have built the vehicle first -- and vehicle grids are stored in the handler for build events. Could you post the save, so that I can try to reproduce why there is no grid_data?

Meanwhile, you can fix the immediate crash by replacing line 1294 of scripts/event_handlers.lua (else) with

  elseif grid_data then
2 months ago

I just changed the code but haven't restarted, by the way..how do I "post" the save? if you could give me some instructions, that'll be great.

2 months ago

how do I "post" the save? if you could give me some instructions, that'll be great.

If you have an account on the forum, you could send it in a private message. (I'm not sure whether there are size limits. Also, you must have made at least one approved post on the forum before you can send private messages -- kind of a spam protection.) Otherwise, something like Dropbox might work. However, I don't have accounts on Dropbox, Google, etc., so the file should be publicly accessible.

2 months ago

I could send one via google drive

2 months ago

Also, I have noticed that placing the equipment like portable generator works fine on vehicles but it still gives that error to player equipment

2 months ago
(updated 2 months ago)

I could send one via google drive

That would be OK, as long as I don't have to log in.

Also, I have noticed that placing the equipment like portable generator works fine on vehicles but it still gives that error to player equipment

Interesting! Did you get the crash on adding/removing equipment to/from your personal grid? This would definitely explain why there was no grid data (we only store vehicle grids).

2 months ago

OK, I could reproduce this. There actually was a safeguard against responding to changes to unregistered grids, but for some reason I've commented it out in the last version. Uncomment lines 1274-1278 in scripts/event_handlers.lua by removing --~ from the start of each line! That should fix the crash.

2 months ago

The lines were already uncommented

2 months ago

Are you sure? I mean this block in function common_events.on_player_placed_equipment:

--~ -- 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
2 months ago

New error popped up today.
The mod AAI Programmable Vehicles (0.7.25) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event aai-programmable-vehicles::on_player_driving_changed_state (ID 28)
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_equipment_inserted (ID 174)
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>
stack traceback:
[C]: in function 'put'
aai-programmable-vehicles/scripts/util.lua:414: in function 'copy_equipment_grid'
aai-programmable-vehicles/scripts/util.lua:441: in function 'transfer_equipment_grid'
aai-programmable-vehicles/control.lua:1023: in function 'unit_create_entity_from_entity'
aai-programmable-vehicles/control.lua:1300: in function 'unit_update_mode'
aai-programmable-vehicles/control.lua:3278: in function 'unit_on_player_enter_vehicle'
aai-programmable-vehicles/control.lua:3467: in function 'callback'
aai-programmable-vehicles/scripts/event.lua:14: in function <aai-programmable-vehicles/scripts/event.lua:12>

a month ago

Should be fixed in version 1.1.16. Can you confirm that?

New response