Locomotives use the energy_source tag so for me they can use electricity.
I've made one that act like a roboport for energy, so it has an inner accumulator and then could work outside a network.
- They act like they were out of an electric network, maybe becasue this is a entity that can move.
- According to this bug report (setting energy using script is not possible), we can't put energy by script because energy is lost for the next tick, so not possible to do this.
But it's possible to do this.
Code: Select all
/c for _,player in pairs(game.players) do if player.vehicle then player.vehicle.energy=150000 end end
Code: Select all
/c game.onevent(0,function() for _,player in pairs(game.players) do if player.vehicle then player.vehicle.energy=150000 end end end)
- In the case we put electricity for a train, they don't need an additionnal gui page for fuel and if we try to go to this page we get this crash.
Code: Select all
#0 0x000000000050d6a9 in CrashHandler::SignalHandler(int) at /home/build/Factorio/src/Util/CrashHandler.cpp:139 #1 0x00007f9f08dded40 in ?? at ??:0 #2 0x00000000007a9491 in std::vector<ItemStack*, std::allocator<ItemStack*> >::size() const at /usr/include/c++/4.8/bits/stl_vector.h:646 (discriminator 1) Inventory::size() const /home/build/Factorio/src/Item/Inventory.hpp:82 (discriminator 1) BurnerInfo /home/build/Factorio/src/Gui/BurnerInfo.cpp:19 (discriminator 1) #3 0x00000000009031d2 in LocomotiveGui at /home/build/Factorio/src/Gui/TrainGui.cpp:257 TrainGui::switchView() /home/build/Factorio/src/Gui/TrainGui.cpp:321 #4 0x00000000006da691 in Slot::mouseDownCB(agui::MouseEvent&) at /home/build/build_environment/boost_1_57_0/output_linux64/include/boost/variant/variant.hpp:1282 #5 0x0000000000a08893 in agui::Widget::_dispatchMouseListenerEvent(agui::MouseEvent::MouseEventEnum, agui::MouseEvent&) at ??:? #6 0x0000000000a0fc4b in agui::Gui::handleMouseDown(agui::MouseInput const&) at ??:? #7 0x0000000000a106f5 in agui::Gui::_dispatchMouseEvents() at ??:? #8 0x0000000000a107a2 in agui::Gui::logic() at ??:? #9 0x00000000009619c2 in GlobalContext::updateGui() at /home/build/Factorio/src/GlobalContext.cpp:645 processAllegroEvent /home/build/Factorio/src/MainLoop.cpp:109 processAllegroEvents /home/build/Factorio/src/MainLoop.cpp:131 #10 0x00000000009638c7 in tickStep at /home/build/Factorio/src/MainLoop.cpp:370 run /home/build/Factorio/src/MainLoop.cpp:450 #11 0x00000000009959dc in main at /home/build/Factorio/src/Main.cpp:267 (discriminator 3) #12 0x00007f9f08dc9ec5 in ?? at ??:0 #13 0x000000000040f039 in _start at ??:? 470765.716732 Error Util.cpp:43: Unexpected error occurred. You can help us to solve the problem by posting the contents of the log file on the Factorio forums.
Code: Select all
burner =
{
effectivity = 0.6,
fuel_inventory_size = 1,
smoke =
{
{
name = "smoke",
deviation = {0.25, 0.25},
frequency = 50,
position = {0, 1.5},
slow_down_factor = 0.9,
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5
}
}
}
Code: Select all
energy_source =
{
type = "burner",
effectivity = 1,
fuel_inventory_size = 3,
smoke =
{
{
name = "smoke",
deviation = {0.1, 0.1},
frequency = 210,
position = {0, 0},
slow_down_factor = 3,
starting_frame = 1,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5,
height = 2,
height_deviation = 0.2,
starting_vertical_speed = 0.2,
starting_vertical_speed_deviation = 0.06,
}
}
}