I've been trying to add more fuel types to beamng beyond "gas" "diesel" and "kerosene", specifically CNG and LNG. I've never used LUA before, but it seems pretty simply, and by editing the fuelTank.lua file in the game directory, I was able to get the game to recognize CNG as a fuel type. However, if I try to make it into it's own seperate file, (by copying the entire LUA file and putting in a mod) it won't work. So, I was wondering if anyone knows how to make a lua file work so it can be packed into a mod. Just for reference, the relevant code section is Code: elseif storage.energyType == "CNG" then storage.energyDensity = 53.6 * 1000000 --MJ/kg storage.fuelLiquidDensity = 0.13 elseif storage.energyType == "LNG" then storage.energyDensity = 53.6 * 1000000 --MJ/kg storage.fuelLiquidDensity = 0.5
Yeah, it's defined in the lua file. I've never tried using it, but if you set an engine's fuel type to "kerosene" it should work
Usually you copy the file into you mods directory and mimic the folder structure there one to one, but you are not able to upload you mod to the repo bacause you are not allowed to overwrite any game data files see here. You may find a way to get you code into the game without overwriting game data files.
I actually did that, just copy the entire fuelTank.lua into the mod and it didn't do anything. Only changing the file in the game directory seemed to work.
Experienced the same issues when I was trying to implement methanol fuel for the Monster Truck. Ultimately gave up in the end.
Really? Damn, maybe it's just not possible then. I suppose we could ask the developers to put CNG and LNG into the game. It would take all of 30 seconds, and would be useful for a natural gas powered bus config, among other things.
Maybe this is similar case as was with custom controller, where Diamondback needed to make some reorganizing to get custom shift logic etc. possible.
Yeah, maybe. Could @Diamondback provide some feedback on this? I'd like to know if it's at least possible.