Electric Train


Adds electric locomotives to the game.

Content
4 years ago
0.14 - 1.1
76.4K
Trains

b Bug after update 0.16 -> 0.17

5 years ago
(updated 5 years ago)

I got this message on loading map:
Error while running event ElectricTrain::on_tick (ID 0)
Can't set currently burning to an item without a fuel value
stack traceback:
ElectricTrain/lua/logic_event_handler.lua:77: in function <ElectricTrain/lua/logic_event_handler.lua:55>
stack traceback:
[C]: in function 'newindex'
__ElectricTrain
/lua/logic_event_handler.lua:77: in function <ElectricTrain/lua/logic_event_handler.lua:55>

Another error on E-Loco placement:
Error while running event ElectricTrain::on_built_entity (ID 6)
Can't set currently burning to an item without a fuel value
stack traceback:
ElectricTrain/lua/logic_event_handler.lua:11: in function <ElectricTrain/lua/logic_event_handler.lua:4>
stack traceback:
[C]: in function 'newindex'
__ElectricTrain
/lua/logic_event_handler.lua:11: in function <ElectricTrain/lua/logic_event_handler.lua:4>

5 years ago

unfortunately, I can't understand it. do you use other mods and which factorio version do you use? i'll do a few more tests, but I'm currently unable to generate the error.

5 years ago
(updated 5 years ago)

Peter what mods do you use it with? Got the same error in 0.17 in multiplayer while placing a train.
TSM?
Event-Handler mod?

5 years ago
(updated 5 years ago)

I fixed it for myself by changing line 7 in lua/basic_event_handler.lua to:
global.Fuel = game.item_prototypes['et-electric-locomotive-fuel']
and "et-electric-locomotive-fuel" deepcopy i changed from "wood" to "nuclear-fuel"
i dont know if i broke something, but for now, its working.

My mods:
https://pastebin.com/8SQ2G5zy

5 years ago

did you update this mod from 0.16 or started a new game?

5 years ago

updated from 0.16

5 years ago

i started a new game so seems to be an error on both

5 years ago

i played with 0.17.6 before, and after the update today i get this.

Error while running event ElectricTrain::on_tick (ID 0)
Can't set currently burning to an item without a fuel value
stack traceback:
ElectricTrain/lua/logic_event_handler.lua:77: in function <ElectricTrain/lua/logic_event_handler.lua:55>
stack traceback:
[C]: in function 'newindex'
__ElectricTrain
/lua/logic_event_handler.lua:77: in function <ElectricTrain/lua/logic_event_handler.lua:55>

related?

5 years ago

changing "et-electric-locomotive-fuel" deepcopy from "wood" to "nuclear-fuel" worked for me as well, did not change anything else

5 years ago

I used both of the fixes (global.fuel as well as 'wood' -> 'nuclear-fuel'), and the problem is still persisting. It seems mine is throwing the error on placement, not during the OnTick:

Error while running event ElectricTrain::on_built_entity (ID 6)
Can't set currently burning to an item without a fuel value
stack traceback:
ElectricTrain/lua/logic_event_handler.lua:11: in function <ElectricTrain/lua/logic_event_handler.lua:4>
stack traceback:
[C]: in function 'newindex'
__ElectricTrain
/lua/logic_event_handler.lua:11: in function <ElectricTrain/lua/logic_event_handler.lua:4>

To my knowedge, the game thinks that the 'et-electric-locomotive-fuel' doesn't have a burn time, even though it is supposed to be a deep copy of the 'wood' or 'nuclear-fuel' items.

5 years ago

Since I just stumbled across a solution, I feel obligated to provide the solution I found: in the file logic_event_handler.lua, I replaced every instance of "global.Fuel" with "game.item_prototypes['et-electric-locomotive-fuel']". This includes instances that has ".fuel_value" appended, where I left those alone.

It seems, for some reason or another, the game doesn't like the generic global.Fuel. I'm partially sure that it got initialized and that the correct values were stored, but I really don't understand what was going wrong. At least it's acting like it's supposed to now...

5 years ago

a new version is online. its the first attempt to fix the issue.

5 years ago

For me it is just the opposite, version 0201 works fine with new or old 0.16 games. But version 3 shows the same error of Peter9184 and mobsterer with old 0.16 games. A new saved game worked. Stepped back to 0201 and all worked fine again.

5 years ago

BTW, you should skip the versioning to 0.17.202. Then automatic updates should work again.

5 years ago

I got that error today, "Peter9184"s solution did not fix the problem, only after I added "Coolguybest"s solution, then it works.

5 years ago

error is still in sadly :(

5 years ago
(updated 5 years ago)

Same here, but with a save that has never seen .16
Ive had to remove deadlock stacking due to it having issues with latest yuoki and angelpetrochem, and on loading the save after removing that, got the error...this maybe unrelated
factorio is latest version, all mods latest versions

Full error from log -
https://pastebin.com/raw/rE0YLMNk

Just to add, non of my trains actually have any fuel in them, they charge at ltn depot and dont use "fuel"

5 years ago

And I can confirm the fixes listed above worked for me....

New response