ZElectricVehicles

by N0TZ3R0

Adds an Electrical Transformer to power-up your vehicles. With this mod you can turn almost any vehicle into an electric vehicle.

Content
a month ago
1.1 - 2.0
3.19K
Transportation

g Error !

2 years ago

Hello, NOTZ3RO :)
Error occured.

Error while running event Electric Vehicles::on_tick (IDO) __ZElectricVehicles_ /controllua:81: attempt to index field 'burner' (a nil value) stack traceback: __ZElectric Vehicles /control.lua:81: in function 'handler'
core
/lualib/event_handler.lua:47: in function <__core_ _/lualib/event_handler.lua:45>

Perhaps it has something to do with the "Schall Perpetual Machine" mod. An error occurred while placing the train with this mod applied on the railroad track.

Do you have any way to solve this?
thank you!

2 years ago

Same issue, I've seen it occur with certain types of locomotive (ex. SE Space Train) with Railway Motor Car.

Fixed it by going to %APPDATA%/Roaming/Factorio/mods, unzipping ZElectricVehicles_1.2.1.zip into the same folder (Factorio can run mods from an unzipped folder, and uses them preferentially over a zip of that mod in the same directory), then editing control.lua.

Change line 75 from elseif not car.grid then to elseif not car.grid or not car.burner then. This adds a check to make sure the vehicle has a defined burner before trying to index it.

Also, if you have another mod (ex. Schall's Arachnid Platoon, Krastorio) that adds burners to spidertrons and want the electric vehicles to work on them without enabling the "Make Spidertron consume burnable fuel" setting, change line 30 from VEHICLE_TYPES = { "car", "locomotive" } to VEHICLE_TYPES = { "car", "locomotive", "spider-vehicle" }, to make the mod always consider spidertron-typed vehicles, even if the mod didn't personally add burners to them. With the above burner check, this is safe even if some spidertrons don't have burners.

Save the file, then load Factorio as normal.

2 years ago

Wow, thank you! kaedys!
By the way, shouldn't the control.lua file be modified and then compressed again? Should I modify it and leave it uncompressed?
I'm not familiar with programming, so I'm asking.
Anyway, thank you very much. kaedys :)

2 years ago

You can re-compress it, or leave it as is, as long as you do it with the full folder, and not just that file. Any mod I modify locally, I just unzip into the /mods folder and manipulate directly, rather than muck with re-zipping it. Factorio will load unzipped mods out of that folder just like it will zipped ones, and if the same mod is in there as both a zip and a folder, it'll use the folder over the zip. So if you just unzip it into that same /mods folder, you can modify it in place and then just use it as is, unzipped, and Factorio won't care.

2 years ago

Okay. thank you :) bbbb

11 months ago

Change line 75 from elseif not car.grid then to elseif not car.grid or not car.burner then. This adds a check to make sure the vehicle has a defined burner before trying to index it.

I'm implementing that RN, new release will contain that by default ;)

This thread has been locked.