About the mod Ever noticed that when you open a door, external sounds don't get louder? This mod is an attempt to fix that. How it works: every time a frame changes, the code checks if a door is opened, glass is broken etc. Based on received information, it calculates the correct sound muffling value. The triggers to check (door, glass, coupler etc.) are determined by a separate file for each vehicle config. This version of mod works with all Stambecco and some D-Series configs (60 separate files in total). At this point, I'm not planning to add dynamicFilter files for other vehicles and configs, as it's quite time consuming. However, you can create your own dynamicFilter files for any vanilla or modded vehicles (see the tutorial below). Creating a custom dynamic cabin filter file A file has to be named like this: dynamicFilter_configName.json and have the following file path: vehicles\vehicleName (for example, vehicles\pickup\dynamicFilter_d15_4wd_A.json). Some JSON syntax understanding is necessary. Code: { "door_left": { "fullDecrease": 0.7, "triggers": { "coupler": { "role": "active", "function": "return function() return electrics.values.doorFLCoupler_notAttached end", }, "hinges": { "role": "passive", "function": "return function() return obj:beamIsBroken(2306) or obj:beamIsBroken(2300) end", }, "glass": { "role": "passive", "partialDecrease": 0.8, "function": "return function() local function check() for key, value in pairs(beamstate.deformedBeams) do if v.data.beams[key]['deformGroup'] == 'doorglass_FL_break' then return true end end return false end return obj:beamIsBroken(2387) or check() end", } } }, } The "fullDecrease" parameter determines how much a trigger group can reduce the cabinFilterStrength value (0.7 = 70%). For example, if current cabin muffling value is 0.54, then the "door_left" trigger group cannot reduce it more than to 0.54 - 0.54x70% = 0.162. The "function" parameter is any function that returns some boolean value. The "return" statement at be the beginning is necessary as lua has to convert the json string to executable code by using the load(string) function. For example, load("return function() return true end")()(). The "role" parameter sets the trigger behavior. "passive" means that once the trigger returns a truthy value, it is removed from the update list to save the computer resourses. If there's no "partialDecrease" parameter set for such trigger, all the triggers from the corresponding trigger group are removed from the update list. "active" means that the trigger can both reduce and increase the cabinFilter value. For example, this can be used with openable doors. The "partialDecrease" parameter works only with "role" parameter set to "passive". Its purpose is to make the trigger reduce the cabinFilter value only partially. This is useful when a door has, for example, some small glass. Obviously, when it breaks, the rest of the door stays in place, still muffling the external sounds. In this particular example, if the "glass" trigger is triggered, then the cabinFilter value is reduced only by 0.8x0.7 = 0.56 = 56%.
Ngl I'd pay actual money for all the other vanilla vehicles to get this feature. But even if you don't change your mind about creating files for them, this is great work as is. Cheers !