Kervinou Posted February 16, 2022 Posted February 16, 2022 Indispensable ! Merci System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box
Toumal Posted February 18, 2022 Posted February 18, 2022 Small update: Unfortunately on very active maps with lots of PvP and PvE activity, the script doesn't run stable for me. I do not know why as the whole thing just freezes with no log output. Did anyone else experience this?
Toumal Posted February 18, 2022 Posted February 18, 2022 Aaaand another update: I think I fixed the stability issue - seems like the tracked_weapons map was growing over time. I added an attribute called launchTime in the onWpnEvent function: function onWpnEvent(event) if event.id == world.event.S_EVENT_SHOT then if event.weapon then local ordnance = event.weapon local weapon_desc = ordnance:getDesc() if string.find(ordnance:getTypeName(), "weapons.shells") then debugMsg("event shot, but not tracking: "..ordnance:getTypeName()) return --we wont track these types of weapons, so exit here end if explTable[ordnance:getTypeName()] then -- trigger.action.outText(ordnance:getTypeName().." found.", 10) else -- env.info(ordnance:getTypeName().." missing from Splash Damage script") if splash_damage_options.weapon_missing_message == true then trigger.action.outText(ordnance:getTypeName().." missing from Splash Damage script", 10) debugMsg("desc: "..mist.utils.tableShow(weapon_desc)) end end if (weapon_desc.category ~= 0) and event.initiator then local launchingUnit = ordnance:getLauncher() local launchingCoalition local launchingPlayerName if (launchingUnit ~= nil) then launchingCoalition = launchingUnit:getCoalition() launchingPlayerName = launchingUnit:getPlayerName() end if (weapon_desc.category == 1) then if (weapon_desc.MissileCategory ~= 1 and weapon_desc.MissileCategory ~= 2) then tracked_weapons[event.weapon.id_] = { wpn = ordnance, init = event.initiator:getName(), pos = ordnance:getPoint(), dir = ordnance:getPosition().x, name = ordnance:getTypeName(), speed = ordnance:getVelocity(), cat = ordnance:getCategory(), unit = launchingUnit, coalition = launchingCoalition, player = launchingPlayerName, launchTime = timer.getTime() } end else tracked_weapons[event.weapon.id_] = { wpn = ordnance, init = event.initiator:getName(), pos = ordnance:getPoint(), dir = ordnance:getPosition().x, name = ordnance:getTypeName(), speed = ordnance:getVelocity(), cat = ordnance:getCategory(), unit = launchingUnit, coalition = launchingCoalition, player = launchingPlayerName, launchTime = timer.getTime() } end end end end end (Note, I also added some extra information which I use to trigger MOOSE scoring for things killed by the shockwave) Then in the track_wpns() function, I added a bit that removes entries after 1200 seconds, no matter what. function track_wpns() -- env.info("Weapon Track Start") for wpn_id_, wpnData in pairs(tracked_weapons) do if wpnData.wpn:isExist() then -- just update speed, position and direction. wpnData.pos = wpnData.wpn:getPosition().p wpnData.dir = wpnData.wpn:getPosition().x wpnData.speed = wpnData.wpn:getVelocity() --wpnData.lastIP = land.getIP(wpnData.pos, wpnData.dir, 50) else -- wpn no longer exists, must be dead. -- trigger.action.outText("Weapon impacted, mass of weapon warhead is " .. wpnData.exMass, 2) local ip = land.getIP(wpnData.pos, wpnData.dir, lookahead(wpnData.speed)) -- terrain intersection point with weapon's nose. Only search out 20 meters though. local impactPoint if not ip then -- use last calculated IP impactPoint = wpnData.pos -- trigger.action.outText("Impact Point:\nPos X: " .. impactPoint.x .. "\nPos Z: " .. impactPoint.z, 2) else -- use intersection point impactPoint = ip -- trigger.action.outText("Impact Point:\nPos X: " .. impactPoint.x .. "\nPos Z: " .. impactPoint.z, 2) end --env.info("Weapon is gone") -- Got to here -- --trigger.action.outText("Weapon Type was: ".. wpnData.name, 20) if splash_damage_options.larger_explosions == true then --env.info("triggered explosion size: "..getWeaponExplosive(wpnData.name)) trigger.action.explosion(impactPoint, getWeaponExplosive(wpnData.name)) --trigger.action.smoke(impactPoint, 0) end --if wpnData.cat == Weapon.Category.ROCKET then blastWave(impactPoint, splash_damage_options.blast_search_radius, wpnData.ordnance, getWeaponExplosive(wpnData.name), wpnData.unit, wpnData.coalition, wpnData.player) --end tracked_weapons[wpn_id_] = nil -- remove from tracked weapons first. end if (timer.getTime() > wpnData.launchTime + 1200) then tracked_weapons[wpn_id_] = nil end end -- env.info("Weapon Track End") end 2
Grimm Posted February 18, 2022 Author Posted February 18, 2022 Hi @Toumal, thanks for looking into this in such detail. Sorry I have been busy with my RotorOps project! Do you know how the tracked_weapons table is growing undesirably? From the existing code it looks like we remove the weapon object from the table when isExist() is false. Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Toumal Posted February 19, 2022 Posted February 19, 2022 On 2/18/2022 at 10:18 PM, Grimm said: Hi @Toumal, thanks for looking into this in such detail. Sorry I have been busy with my RotorOps project! Do you know how the tracked_weapons table is growing undesirably? From the existing code it looks like we remove the weapon object from the table when isExist() is false. My guess is that isExist() doesn't become false reliably.
Kervinou Posted February 19, 2022 Posted February 19, 2022 Hi ! is there an update of the script ? thanks System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box
Grimm Posted February 20, 2022 Author Posted February 20, 2022 (edited) 1 hour ago, Toumal said: My guess is that isExist() doesn't become false reliably. It would be good to know under what circumstances this is happening. Since this is the primary method for triggering the extra damage attributes of the script. Are missiles landing softly in the grass somewhere or going off the map into space? How can I recreate the issues you saw? Edited February 20, 2022 by Grimm Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Toumal Posted February 24, 2022 Posted February 24, 2022 On 2/20/2022 at 1:19 AM, Grimm said: It would be good to know under what circumstances this is happening. Since this is the primary method for triggering the extra damage attributes of the script. Are missiles landing softly in the grass somewhere or going off the map into space? How can I recreate the issues you saw? I wish I was able to reproduce it reliably. All I can say is, since I made this change the server runs stable. It may well be that I only got that crash because there's quite a lot going on in my mission, so running for the full 8 hours tends to expose more problems.
Grimm Posted February 24, 2022 Author Posted February 24, 2022 4 hours ago, Toumal said: I wish I was able to reproduce it reliably. All I can say is, since I made this change the server runs stable. It may well be that I only got that crash because there's quite a lot going on in my mission, so running for the full 8 hours tends to expose more problems. Fair enough. I appreciate the time you've spent looking into it and the info you've provided. Can you confirm that you know for sure that the weapons table was growing undesirably? Just want to be sure there's an issue before I spend a lot of time trying to reproduce it. Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Toumal Posted February 26, 2022 Posted February 26, 2022 On 2/24/2022 at 9:57 PM, Grimm said: Fair enough. I appreciate the time you've spent looking into it and the info you've provided. Can you confirm that you know for sure that the weapons table was growing undesirably? Just want to be sure there's an issue before I spend a lot of time trying to reproduce it. Without a debugger and the ability to hook into the LUA interpreter running on the server, I cannot be 100% sure. All I can say is: The server stopped multiple times and had to be manually killed. Once I added the above sections, the problem went away and we have been running for over a week with lots of players and activity, and no server hang or crash. In any case, I would personally prefer a bit of defensive coding over relying that everything else works fine. In any case, if nobody else has a problem with the current script that's fine of course - and those who find their server hanging can just add the fix.
Grimm Posted February 26, 2022 Author Posted February 26, 2022 (edited) 19 minutes ago, Toumal said: Without a debugger and the ability to hook into the LUA interpreter running on the server, I cannot be 100% sure. All I can say is: The server stopped multiple times and had to be manually killed. Once I added the above sections, the problem went away and we have been running for over a week with lots of players and activity, and no server hang or crash. In any case, I would personally prefer a bit of defensive coding over relying that everything else works fine. In any case, if nobody else has a problem with the current script that's fine of course - and those who find their server hanging can just add the fix. Would you mind adding a logging statement to the condition where you remove the table entry? if (timer.getTime() > wpnData.launchTime + 1200) then env.warning("Removing old "..wpnData.name.." from weapon table.") tracked_weapons[wpn_id_] = nil end Something like this? That should give us all the information we need. Edited February 26, 2022 by Grimm Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Toumal Posted March 1, 2022 Posted March 1, 2022 Roger that, I'll do that and check over the next days what happens. 2
ked Posted March 12, 2022 Posted March 12, 2022 (edited) I added the HOT3 on my end, not sure about the value it seems to correspond to the explosive payload for other payloads. ["HOT3"] = 6, Can you confirm it is correct and add it if all is ok ? Thanks a lot for the script Edited March 12, 2022 by ked
Kervinou Posted March 13, 2022 Posted March 13, 2022 And another question, what about AGM-65 ? thanks ;-) System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box
bennyboy9800 Posted March 23, 2022 Posted March 23, 2022 (edited) Hello, does this script help solve some of the issues with trees blocking ordinance damage? I'd really like to be able to pierce a treetop with a GBU-38 to kill units underneath Edited March 23, 2022 by bennyboy9800 Intel i7 9700k CPU Nvidia GTX 1080Ti 16GB RAM Samsung 256GB SSD Thrustmaster T16000m HOTAS
Swampy Posted March 29, 2022 Posted March 29, 2022 @GrimmI tried adding the 114K but it crashes the script. I am using the latest version. Any suggestions?
Grimm Posted April 16, 2022 Author Posted April 16, 2022 On 3/22/2022 at 9:27 PM, bennyboy9800 said: Hello, does this script help solve some of the issues with trees blocking ordinance damage? I'd really like to be able to pierce a treetop with a GBU-38 to kill units underneath Yes. Would you be interested in running a test and reporting your results here? Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Grimm Posted April 16, 2022 Author Posted April 16, 2022 Updated with new weapons: ["AGM_114K"] = 10, ["HYDRA_70_M229"] = 8, ["AGM_65D"] = 130, ["AGM_65E"] = 300, ["AGM_65F"] = 300, ["HOT3"] = 15, ["AGR_20A"] = 8, ["GBU_54_V_1B"] = 118, Also added a new rocket_multiplier option for boosting effectiveness of all rockets. I tried with this value set at 5 and didn't think it was too 'arcade', but set the default to 3 to be safe? Play with it and let me know! Splash_Damage_2_0.lua 1 Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Grimm Posted April 16, 2022 Author Posted April 16, 2022 Here's a helicopter mission with this updated script. Slots for most helos. Let me know what you think of the rockets. https://dcs-helicopters.com/downloads/Caucasus Conflict - Batumi to Kobuleti Sat101953.miz Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
Rick50 Posted April 17, 2022 Posted April 17, 2022 Sorry Can't help with scripting or debugging.... ... just a big thanks!!
Kervinou Posted April 18, 2022 Posted April 18, 2022 Thanks ! I will use your values System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box
Grimm Posted April 18, 2022 Author Posted April 18, 2022 Anyone tested rockets with the new script above? Trying to make sure they're not too overpowered. Please let me know. Splash Damage 2.0: Make explosions better! RotorOps: Helicopter Mission Generator
huo33322 Posted April 27, 2022 Posted April 27, 2022 Hello,Thanks for your script. And I have a question about CBU-87.I added ["CBU_87"] = 100,such as.But it looks like not work correct.what should I do?
Toumal Posted April 28, 2022 Posted April 28, 2022 On 4/16/2022 at 6:20 PM, Grimm said: Updated with new weapons: ["AGM_114K"] = 10, ["HYDRA_70_M229"] = 8, ["AGM_65D"] = 130, ["AGM_65E"] = 300, ["AGM_65F"] = 300, ["HOT3"] = 15, ["AGR_20A"] = 8, ["GBU_54_V_1B"] = 118, Also added a new rocket_multiplier option for boosting effectiveness of all rockets. I tried with this value set at 5 and didn't think it was too 'arcade', but set the default to 3 to be safe? Play with it and let me know! Splash_Damage_2_0.lua 19.29 kB · 33 downloads If you haven't already, you might wanna add the AGM-84E SLAM-ER: ["AGM_84E"] = 488 This is based on the warhead size compared to similar sized bombs. You might want to lower that a bit if you think the damage is too extreme.
markturner1960 Posted May 7, 2022 Posted May 7, 2022 Sorry, I have looked but cant find how to load the script within the mission editor? It has to be loaded manually into every mission you want the new effects in, is that correct? System specs: PC1 :Scan 3XS Ryzen 5900X, 64GB Corsair veng DDR4 3600, EVGA GTX 3090 Win 10, Quest Pro, Samsung Odyssey G9 Neo monitor.
Recommended Posts