Electric Trains


Adds electric trains.

Content
11 days ago
0.16 - 2.0
49.7K
Trains

i Double head locomotives

6 years ago
(updated 6 years ago)

Last time i check, real electric locomotives can also drive backwards :)

can u improove your mod by adding this code:

if event.train.state == defines.train_state.no_path then
for k, v in pairs(event.train.locomotives.front_movers) do
local front = v.disconnect_rolling_stock(defines.rail_direction.front)
local back = v.disconnect_rolling_stock(defines.rail_direction.back)
v.rotate()
if front == true then
v.connect_rolling_stock(defines.rail_direction.back)
end
if back == true then
v.connect_rolling_stock(defines.rail_direction.front)
end
v.train.manual_mode = false
end
end

to train_changed_state event handler? also locomotive.pictures would needs to be updated...

EDIT: tweaked that code a little an its working well (graphics sucks - tweaked base loco in gimp by deleting back half :D ) ...

can send it to u (48MB) ...

6 years ago

Actually, the electric locomotive is already configured to be equally efficient in both directions. Place one of them facing backwards, and it should perform in either direction as if it was double-headed, already. The 'no path' problem if you have all the locomotives facing one way is a limitation of the base game, but it's easy enough to work around.

New response