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

g [Fixed?] on_script_path_request_finished crash

1 year, 26 days ago

An interesting one. I was having my tank drive between some biter nests on my way to a new patch of ore, and I'd occasionally get out and fight alongside it to add my weapons to the fight, targeting the nests while the tank kept me safe. A few seconds after an autosave (so this is very repeatable) I got a non-recoverable error that kicked me to the menu. Related to pathing or rendering apparently. Let me know if I can get you any more useful information.

It crashes regardless of whether or not I'm in the vehicle, and the end of the path is still several hundred meters out.

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

Error while running event autodrive::on_script_path_request_finished (ID 119)
'target': table expected, got nil
stack traceback:
    [C]: in function 'draw_circle'
    __autodrive__/scripts/pathing.lua:110: in function 'render_target'
    __autodrive__/scripts/pathing.lua:358: in function 'request_path_finished'
    __autodrive__/scripts/event_handlers.lua:1426: in function <__autodrive__/scripts/event_handlers.lua:1421>
1 year, 26 days ago

The immediate fix is to make this block (lines 110ff. in scripts/pathing.lua):

state.pointer = rendering.draw_circle({
  color = {r = 0.7, g = 0.7, b = 0.3 },
  radius = 0.25,
  filled = true,
  target = state.goal,
  surface = vehicle.surface,
  forces = { vehicle.force },
  draw_on_ground = true,
})

conditional:

if state.goal then
  state.pointer = rendering.draw_circle({
    ...      
  })
end

This makes sure that the position state.goal actually exists before trying to render the dot. But the really interesting question is how/why state.goal was removed in your case. A saved game may help to find the reason and fix the crash at its source. :-)

1 year, 26 days ago

Ah, nice, thank you. Unfortunately, I forgot how quickly Factorio rolls its three autosaves and so I can't now supply one. Sorry for that. I'll be doing a similar task shortly so I'll get back to you if I can get it to happen again.

At a guess, it may be related to the fact that my tank was continuously "panicking" trying to avoid the biters while I was getting in and out after having set a long-term goal. It also ran out of fuel at one point during the trek, so there was quite a variety of interesting events happening to it on our journey to gather more wolframite.

11 months ago

Should be fixed in version 1.1.7!

New response