Closed mlewelt closed 2 years ago
Will check it tommorrow :-) Just need to update to 1.2 first and stuff
Noticed after checking that it uses updateDamageAmount to get the (delta) value for updating damage amount and node wear amount. It should be fixed now in 0.1.4.0. Let me know if it fixed the problem :-)
Just tested again. Now the wearable damage scales correctly with your wear factor. The wearNode amount however doesnt get scaled down. I dont know how the value wearNode amount is used. Everything i have seen only uses the wear damage via vehicle.getVehicleDamage() so your mod should work as expected now :) The combine for example uses getVehicleDamage() when calculating yield: combine.lua (line 1336) local damage = self:getVehicleDamage() if damage > 0 then deltaFillLevel = deltaFillLevel (1 - damage Combine.DAMAGED_YIELD_REDUCTION) end
So after testing this it appears that your mod only changes the factor for the wear node damage amount. However, following the source code in vehicle/specs/Wearable.lua the getVehicleDamage() function uses the wear damage from the xml. (see vehicle/specs/Wearable.lua line 133 (function onLoadFinished()). I also tested this. With the wear factor on 0.25 the tractor still gets the same damage value added, thus having the same consequences. Dont know why there are 2 damage values (one for the node and the "main" damage value) but i think you have to apply your factor to both.