I'm trying to make a ghost engine so that I can layer engine sounds. I almost got it but I seem to be missing something. I did it two different ways, but neither worked. And yes, I modified combustionEngine.lua and vehicleController.lua
If this could work, it could well and truly make engine sounds mods way more realistic for BeamNG. I tried to see if it was possible a while ago, but no one knew anything about it. Were you able to get both engines working at the same time, both producing their own sounds?
I did a while ago, hadn't done it recently. NOCARGO had given me an example project that used for reference, but I think I may have accidentally deleted it and the link to redownload it is expired. He also told me to use his I8 for the crash hard car as an example and to "adopt and adapt" it, though I tried that and nothing seemed to work. He has not been on the forums in over 2 years. --- Post updated --- This is what happens when I select the ghost engine
Damn, that sucks. There's no worse feeling than deleting something that becomes lost media. By the looks of it, the whole vehicle becomes corrupt from the engine, probably because the controllers don't know what to do with 2 engines. I remember trying to add an electric motor in series with an engine for the Bus, like a mild hybrid. When you would equip the electric motor, it would come with the same error. I know you said you edited the combustionEngine.lua and the vehicle controller, but if it connects to the powertrain system, depending on what gearbox, maybe it's a powertrain controller fault. I know I'm not much of a help at the moment, but I am really interested in this too. This system is perfect for what I need, as I am working on a Voith gearbox for the bus, and the input whine works with engine RPM rather than gear speed. tL-DR: I need a second engine source with a custom blend to make it realistic. Hopefully some advanced BeamNG dev or mod creator replies, because this is something I've needed for ages
I tried porting it to the citybus. It never came up the red error saying a corrupt mod, but it spawned with no gearbox. I took a look into the console and saw this I did change all references to vehiclecontroller2 and combusionengine2. If you haven't already, check the console, there might be something there of value
Alright, I just figured something out. When I change it to combustionengine2.lua and mainengine2.lua here The game throws the console error above. But, if I leave it the same as it was before The game doesnt throw an error when both engines are selected. In the video, at the start, I am using the stock engine. But when I select the ghost engine (Voith sound emitter), the game doesnt bug out, and the powertrain still works. However, it only plays one sound, which is the ghost engine, the I4. So it seems that only one sound event can play at a time
It has to stay like that so it knows to use the those lua files and not the vanilla ones so that it can play multiple soundLayers at once
So does changing that from "combustionEngine" to "combustionEngine2" tell it to use the new lua files? I noticed when I did do that, in the console, it said "Unknown part: MainEngine2" and the powertrain gave up. So it seems that it wasn't edited to understand what "MainEngine2" is and act accordingly. Another thing too, is that the console was changing the file location. Not sure if that's a problem too, but thats there. What about vehicle controller at the bottom, that should be changed to "vehicleController2" too shouldn't it?
Yup. combustionEngine and vehicleController should both be changed to combustionEngine2 and vehicleController2 so it knows to use the new files. The same thing with mainEngine
Damn. I remember seeing a thread about this before, but that was in 2020 and probably not accurate anymore. Hopefully the BeamNG devs or someone experienced might see this though