Hi, I'm working on a mod that simulates vehicle damage using damageTracker.setDamage(category, type, true), and I’ve run into a roadblock. So far, "engine" with "radiatorLeak" works perfectly. But other combinations like "wheel_FR" with "tireDeflated" or "door_FL" with "broken" don’t seem to do anything. Does anyone have a list (or partial list) of supported categories and types? Or is there a way to inspect what parts support this kind of simulated damage? The things I want to do with damageTracker.setDamage() are: Engine lock, Tire deflation, Door damage, and Driveshaft break. Thanks for any help you can provide!
Using Agent Ransack, set the "look in" folder to the lua subfolder of the game install folder and look for damageTracker.setDamage, it'll show you all vanilla instances of the function being used. I highly recommend that software if you're gonna be doing a lot of lua modding in BeamNG. Keep in mind that while this may works for some components (afaik damageTracker is more for the UI damage app, not to add actual damage to the car), for a lot of parts you need to do more than that to actually break them. If you only set the damage tracker state for the driveshaft, it'll show in the UI app as broken but it'll still be working. Powertrain devices have a specific function to break them. For example the driveshaft: Code: powertrain.breakDevice(powertrain.getDevice("driveshaft")) You can take a look at the list of powertrain device names for a vehicle with this Code: for k,v in pairs(powertrain.getDevices()) do print(k) end If I use spindleRR with the previous breakDevice function the rear right wheel just cleanly falls off, and it also updates the damage tracker for you. To deflate tires, for example the front left tire: Code: beamstate.deflateTire(wheels.wheelIDs["FL"]) You can also take a look at my code for loading this type of damage, it's probably not perfect but I got a bunch of stuff in there that might help you out.