FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
291 stars 98 forks source link

SEAD:New( { 'whateverPrefix' } ) doesn't seem to work + Possible invalid missile strings in Moose declaration #1069

Closed Goreuncle closed 5 years ago

Goreuncle commented 5 years ago

I've been messing around with SEAD evasion mechanics and I've noticed that the MOOSE SEAD evasion functionality doesn't seem to work: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Sead.html##(SEAD).New

AA units fail to disable their radars when anti-radiation missiles are fired at them and mobile AA units fail to disperse (they move sometimes, but that's "standard" DCS behaviour, I think, it isn't MOOSE related).

The problem can be observed already in the SEAD Evasion demo mission: https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/SEV%20-%20SEAD%20Evasion

Also, I opened the Moose.lua declaration for SEAD:New and noticed something odd:

local SEADWeaponName = EventData.WeaponName    -- return weapon type
-- Start of the 2nd loop
self:T( "Missile Launched = " .. SEADWeaponName )
if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then -- Check if the missile is a SEAD  

According to my tests, EventData.WeaponName doesn't actually return the string values specified there.

For instance, when a Kh-58U missile is fired, EventData.WeaponName will return the string "weapons.missiles.X_58" instead of "KH-58". Same thing applies to the rest of missiles listed there.

I "corrected" the relevant line in the Moose.lua file I used for my tests, but that didn't solve the issue. I'm guessing there are other problems as well (either that or I'm missing something)

Is Functional.Sead still WIP?

While I'm at it, here's a list of the EventData.WeaponName returned string values for the anti-radiation missiles I've tested so far:

Kh58U = "weapons.missiles.X_58"
Kh25MP = "weapons.missiles.Kh25MP_PRGS1VP"
Kh25MPU = "weapons.missiles.X_25MP"
Kh28 = "weapons.missiles.X_28"   
Kh31P = "weapons.missiles.X_31P"
AGM45A = "weapons.missiles.AGM_45A"
AGM45B = "weapons.missiles.AGM_45"
AGM88C = "weapons.missiles.AGM_88"
AGM122 = "weapons.missiles.AGM_122" 
ALARM = "weapons.missiles.ALARM"
Goreuncle commented 5 years ago

Bump?

The latest Moose.lua include still has this problem.

I've modified line 43535, using the actual returned values for all SEAD missiles I'm aware of:

if SEADWeaponName == "weapons.missiles.X_58" or SEADWeaponName == "weapons.missiles.X_28" or SEADWeaponName == "weapons.missiles.X_25MP" or SEADWeaponName == "weapons.missiles.Kh25MP_PRGS1VP" or SEADWeaponName == "weapons.missiles.X_31P" or SEADWeaponName == "weapons.missiles.AGM_45A" or SEADWeaponName == "weapons.missiles.AGM_45" or SEADWeaponName == "weapons.missiles.AGM_88" or SEADWeaponName == "weapons.missiles.AGM_122" or SEADWeaponName == "weapons.missiles.ALARM" then -- Check if the missile is a SEAD

I guess there are other problems going on as well, since this modification alone doesn't fix SEAD evasion.

Goreuncle commented 5 years ago

A fix has been found and reported here: https://github.com/FlightControl-Master/MOOSE/issues/1186