pierremgi 4910 Posted January 31, 2019 Hello, I'm working on a script which set damage (hit) on the wheels of cars. Hit points can suffer 0.5 or 1. My problem is that damaged cars look like they took bullets and shells on hull. It's a weird representation for flat tires! I'm aware that Arma engine applies normal or damaged models as far as the vehicle is alive, in regard of damages. Here the damage command returns 0. And, i checked, there are only hitpoint "wheelXX" or similar which are > 0 So, my question is: how could I keep an intact hull which punctured tires? Thanks 1 Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted January 31, 2019 Dig through the config for the regular vehicle textures, on the damaged vehicle simply setObjectTexture to the default one, so even when heavily damaged it will look like a pristine editor placed vehicle. Cheers Share this post Link to post Share on other sites
pierremgi 4910 Posted January 31, 2019 Thanks, but it seems to fail. On such damaged hunter, I applied: cursorObject setObjectTexture [0,"a3\soft_f\mrap_01\data\mrap_01_base_co.paa"]; cursorObject setObjectTexture [1,"a3\soft_f\mrap_01\data\mrap_01_adds_co.paa"]; The texture are right but the damage are still displayed. It seems the Arma engine checks for them on each frame and applies the damaged textures. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted January 31, 2019 12 minutes ago, pierremgi said: Thanks, but it seems to fail. On such damaged hunter, I applied: cursorObject setObjectTexture [0,"a3\soft_f\mrap_01\data\mrap_01_base_co.paa"]; cursorObject setObjectTexture [1,"a3\soft_f\mrap_01\data\mrap_01_adds_co.paa"]; The texture are OK but the damage are still here. It seems the Arma engine checks for them on each frame and applies the damaged textures. Here's what I used: _vehicle = this; _state = 1; _type = typeOf _vehicle; _selections = getArray (configfile >> "CfgVehicles" >> _type >> "hiddenSelections"); if (_selections isEqualTo []) exitWith {diag_log "vehDamage: No selections found.";false}; _mats = getArray (configfile >> "CfgVehicles" >> _type >> "Damage" >> "mat"); _textures = getArray (configfile >> "CfgVehicles" >> _type >> "Damage" >> "tex"); if (_type isKindOf "CAManBase") then { _mats = getArray (configfile >> "CfgVehicles" >> _type >> "Wounds" >> "mat"); _textures = getArray (configfile >> "CfgVehicles" >> _type >> "Wounds" >> "tex"); }; _debug = []; _hasMats = !(_mats isEqualTo []); _hasTexs = !(_textures isEqualTo []); if (!_hasMats AND !_hasTexs) exitWith {diag_log "vehDamage: No mats and textures found.";false}; _count = 0; for "_i" from 0 to ((count _selections -1) * 3) step 3 do { if (_hasMats) then { _mat = _mats select (_i + _state); _debug pushback (_i + _state); _debug pushback _mat; _debug pushback "----"; _vehicle setObjectMaterialGlobal [_count,_mat]; }; if (_hasTexs) then { _tex = _textures select (_i + _state); _debug pushback (_i + _state); _debug pushback _tex; _debug pushback "----"; _vehicle setObjectTextureGlobal [_count,_tex]; }; _count = _count + 1; }; true This was made quite some time ago so maybe stuff changed, but was no problem to make a damaged vehicle look like new, even with hull damaged to 0.8. With this you can also make a healthy infantry unit have blood all over the place. Just play with the _state number (up to 3 if I recall correctly). Cheers 4 1 Share this post Link to post Share on other sites
pierremgi 4910 Posted January 31, 2019 Thanks, I'll try to do something with that. Seems to work, playing with state. Now, I'm trying to save the current texture before the tire damage. Just to avoid some unwanted hull "pristine like", when tires are punctured... Well, for an MRAP (hunter) getObjectMaterials cursorObject returns ["","",""] while getObjectTextures cursorObject returns ["a3\soft_f\mrap_01\data\mrap_01_base_co.paa","a3\soft_f\mrap_01\data\mrap_01_adds_co.paa",""] same as: getArray (configfile >> "CfgVehicles" >> typeOf cursorObject >> "hiddenSelectionsTextures"), except for case sensitivity. getArray (configfile >> "CfgVehicles" >> typeOf cursorObject >> "Damage" >> "mat" ) returns ["A3\soft_f\MRAP_01\Data\MRAP_01_adds.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_adds_damage.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_adds_destruct.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_base.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_base_damage.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_base_destruct.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_int.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_int_damage.rvmat","A3\soft_f\MRAP_01\Data\MRAP_01_int_destruct.rvmat","A3\Data_F\Glass_veh.rvmat","A3\Data_F\Glass_veh_armored_damage.rvmat","A3\Data_F\Glass_veh_armored_damage.rvmat","A3\Data_F\Glass_veh_int.rvmat","A3\Data_F\Glass_veh_armored_damage.rvmat","A3\Data_F\Glass_veh_armored_damage.rvmat"] while getArray (configfile >> "CfgVehicles" >> typeOf cursorObject >> "Damage" >> "tex" ) returns []..... Arma's logic? Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted February 1, 2019 11 hours ago, pierremgi said: Arma's logic? I'm usually eager to rant on some decisions regarding BI naming conventions but from the looks of it the config contains all possible materials, while the getObjectMaterials command only returns currently used ones. This wouldn't explain the empty damage textures config though. Maybe the engine is handling stuff differently, similar to this (if related at all) there's also no way to get an objects mass without spawning it and using the getMass command. No mass config entry exists. Cheers 1 Share this post Link to post Share on other sites