I am editing lua/powertrain/combustionEngine.lua. I created a battery which will be charged by the engine. I'd like to let the engine shut down when the battery is charged to 80% and ignite the engine when battery level is below 20%. However, I don't know which part of the lua files controls the engine ignition. How should I program to let the engine work as I expect? (Following by the lua file I edited)
You can use the mod below for reference as it has diesel-engine powering an electric generator for a hybrid setup but basically most of controls for the engine are handled not in combustionEngine.lua but vehicleController.lua. So in order to control it you can leave combustionEngine.lua alone and instead make a custom controller file to operate the engine instead of the main vehicle controls. https://www.beamng.com/resources/t-series-drivetrain-expansion.29462/
Thanks. I tried to learn from this mod. However, the rotators turn out to interfere the driving safety system such as ABS and ESC. They are recognized as wheels with braking system.