Trying to make electric trains, but...
Posted: Fri May 26, 2017 1:18 am
I was tinkering a little earlier today, trying to see if I could get electric trains to work. It seemed a simple enough thing to do. Trains use a burner energy source and since we already have a mobile entity that can make use of electricity (construction/logistics bots) I thought it wouldn't be too hard. I thought wrong.
My general idea is to make locs work in areas with power, and give them a small battery to bridge gaps where needed. Optionally they could simply be given a good sized capacitor and be recharged on stations (IE replace the fuel tanks with accumulators). Optionally make electified railways with overhead powerlines or a third rail that supplies power (like on some tram systems).
To start off I wanted to see if I could change the loc over to electric, by removing the burner and adding an energy drain and capacitance. However, if I do that the game fails to load the mod and complains that the "burner" property of the locomotive isn't defined. Does this mean that the "locomotive" object type is hardcoded to require a burner energy source? I looked around where the "type=locomotive" itself gets defined, but could not find a definition in any of the "base" or "core" folders, so I'm not sure how one'd go about changing the definition of the locomotive as an object structure, rather then the instance of it. I used Notepad++ to search for the word "locomotive" across the entire Factorio folder to try and find the type definition. Got a lot of hits on the tutorial folders and various localizations, but no typecast...
My general idea is to make locs work in areas with power, and give them a small battery to bridge gaps where needed. Optionally they could simply be given a good sized capacitor and be recharged on stations (IE replace the fuel tanks with accumulators). Optionally make electified railways with overhead powerlines or a third rail that supplies power (like on some tram systems).
To start off I wanted to see if I could change the loc over to electric, by removing the burner and adding an energy drain and capacitance. However, if I do that the game fails to load the mod and complains that the "burner" property of the locomotive isn't defined. Does this mean that the "locomotive" object type is hardcoded to require a burner energy source? I looked around where the "type=locomotive" itself gets defined, but could not find a definition in any of the "base" or "core" folders, so I'm not sure how one'd go about changing the definition of the locomotive as an object structure, rather then the instance of it. I used Notepad++ to search for the word "locomotive" across the entire Factorio folder to try and find the type definition. Got a lot of hits on the tutorial folders and various localizations, but no typecast...