I've seen some old threads around with people asking how to destroy their engine using the lua console. Yet I found no answers. So, I decided to do some digging and experimenting of my own. In the process, I discovered how to do such things. I am putting together some useful lines of lua codes that can be run in the console. BeamNG - Vehicle Lua: Powertrain reference and examples: Code: for k,v in pairs(powertrain.getDevice("mainEngine")) do print(k) end Code: powertrain.getDevice("mainEngine").maxTorqueRating = # I hope this gives at least someone a good place to start. Reset your fuel via console: Code: energyStorage.reset() ` Make your fuel tank leak: Code: energyStorage.getStorages().mainTank.currentLeakRate = 0.1 Edit temperatures: Code: powertrain.getDevice("mainEngine").thermals.engineBlockTemperature = 20 powertrain.getDevice("mainEngine").thermals.coolantTemperature = 20
This contains some info, for example how to dump electrics to file etc. which I think might be addition to your excellent listing: https://www.beamng.com/threads/lua-help.56996/ Here is spawning vehicle form LUA: https://www.beamng.com/threads/how-to-spawn-a-vehicle-from-lua.57217/ Maybe we could collect here more of such useful LUA knowledge as it might be really helpful?
What I'd really like to do is use this thread to gather knowledge together, organize it then put it nice and neatly onto the Wiki. Lua parts of the game are missing a lot of documentation so I think this would be quite helpful.