Electric Train 2.0 Fix

by Jtmzac

Basic fix for 2.0 while magu5026 works on the original. I'll remove this once that's been updated. Adds electric locomotives to the game.

Content
22 days ago
2.0
961
Trains

g Error

29 days ago

Hi, while im playing and trains do their jobs, i have error together exit from game "Error while running event ElectricTrainFix::on_nth_tick(2)"
Can you help?

29 days ago

I can't see anything obviously wrong and that error doesn't narrow down the problem very much.

Is there any other information in the error message? There is often more information specifically about what went wrong.

29 days ago

Error while running event ElectricTrainFix::on_nth_tick(2)
ElectricTrainFix/control.lua:174: attempt to index field 'currently_burning' (a nil value)
stack traceback:
ElectricTrainFix/control.lua:174: in function <ElectricTrainFix/control.lua:163>

29 days ago

I quess i have out of energy and i get this error

29 days ago
(updated 29 days ago)

Thanks for the extra information. That's much easier to debug.

I've just released an update with an extra check that should probably fix it.

If it doesn't work, then let me know as I can do some other things to try and fix it.

29 days ago

tyvm, i now try fix too, but im weak in lua scripts and factorio modding, i hope for you

29 days ago

oh, i fix, add line "loc.entity.burner.currently_burning = prototypes.item['et-electric-locomotive-fuel']"
before line "needPower = loc.entity.burner.currently_burning.name.fuel_value - loc.entity.burner.remaining_burning_fuel"

29 days ago

Glad you fixed it. That's almost identical to the fix I did as well.

New response