Draken35 Posted May 3, 2022 Posted May 3, 2022 Scenery Objects does not have a getLife0 method, so, on mission start, I use their getLife method and store the result as the initial health. This value matches with the value of the attribute in getDesc. Now, the issue is that this value is not accurate! The initial reported health goes up after the first weapon hit in that target! See screenshot and attached mission and script please So, How to accurately get Scenery Objects initial Health in LUA? Or what am I doing wrong? sceobj.lua test-sceobj-life-CA.miz
toutenglisse Posted May 3, 2022 Posted May 3, 2022 5 hours ago, Draken35 said: ...So, How to accurately get Scenery Objects initial Health in LUA? Or what am I doing wrong?... I am not sure, something is a bit weird. I've checked that for Static units, the Life at impact (hit event) is the same as initial Life (ex: Workshop A, 1600 pts at hit event, which is correct initial life : DCS-miscScripts/Workshop A.lua at master · mrSkortch/DCS-miscScripts · GitHub ). Units behave differently (damaged at hit). Scenery Objects seem to have the same way to take damage than Statics. To get the life points after hit damage (for Statics and scenery) you have to delay getLife() from Hit event (1s in my test). I run your test mission with several Mk82 attacks until Scenery object is destroyed and all seem OK. The weird thing is that the scenery object life points vary from mission start to hit event. And sometimes it doesn't. test-sceobj-life-CA-mod.miz
Draken35 Posted May 3, 2022 Author Posted May 3, 2022 1 hour ago, toutenglisse said: The weird thing is that the scenery object life points vary from mission start to hit event. And sometimes it doesn't. That's the thing... After the first hit, The scenery objects seem to behave but in none of my tests, the behavior of the initial health (before any impact) has been correct... Thanks for taking the time to test it!
Flappie Posted February 10, 2023 Posted February 10, 2023 A friend told me about this issue and show me this thread. Thanks for bringing this up. It's now reported. ---
Draken35 Posted February 10, 2023 Author Posted February 10, 2023 2 hours ago, Flappie said: A friend told me about this issue and show me this thread. Thanks for bringing this up. It's now reported. Thanks Flappie!
Recommended Posts