Weapons.lua AIM-54 nozzle_exit_area tests Sept. 3, 2022 | DSplayer

Created Diff never expires
-- for warhead functions and default warheads map (for warheads["AIM_65"])
-- for warhead functions and default warheads map (for warheads["AIM_65"])
dofile("Scripts/Database/Weapons/warheads.lua")
dofile("Scripts/Database/Weapons/warheads.lua")






local function bru_42_3x_weapon(clsid,weapon_info,left,right,bottom,attach_offset)
local function bru_42_3x_weapon(clsid,weapon_info,left,right,bottom,attach_offset)


local bru_42_mass = 128
local bru_42_mass = 128
local lvl2 = weapon_info.level2
local lvl2 = weapon_info.level2
if type(weapon_info.wsType)=="table" then
if type(weapon_info.wsType)=="table" then
lvl2 = weapon_info.wsType[2]
lvl2 = weapon_info.wsType[2]
end
end
local ret = {
local ret = {
category = weapon_info.category,
category = weapon_info.category,
CLSID = clsid,
CLSID = clsid,
Picture = weapon_info.picture,
Picture = weapon_info.picture,
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
Cx_pil = 0.0005,
Cx_pil = 0.0005,
Elements = { }
Elements = { }
}
}
if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
if type(weapon_info.wsType)=="string" then
if type(weapon_info.wsType)=="string" then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU42",IsAdapter = true}
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU42",IsAdapter = true}
local sz = 0
local sz = 0
if left then
if left then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_LEFT"}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_LEFT"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if right then
if right then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_RIGHT"}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_RIGHT"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if bottom then
if bottom then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_LOWER"}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "BRU-42_LOWER"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end


ret.Count = sz
ret.Count = sz
ret.Weight = bru_42_mass + sz * weapon_info.mass
ret.Weight = bru_42_mass + sz * weapon_info.mass


ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx
ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx


if sz > 1 then
if sz > 1 then
ret.displayName = sz.." "..weapon_info.name
ret.displayName = sz.." "..weapon_info.name
else
else
ret.displayName = weapon_info.name
ret.displayName = weapon_info.name
end
end
declare_loadout(ret)
declare_loadout(ret)
return ret
return ret
end
end


local function bru_42_3x_bomb(clsid,weapon_info,left,right,bottom,attach_offset)
local function bru_42_3x_bomb(clsid,weapon_info,left,right,bottom,attach_offset)


local bru_42_mass = 128
local bru_42_mass = 128
local lvl2 = weapon_info.level2
local lvl2 = weapon_info.level2
if type(weapon_info.wsType)=="table" then
if type(weapon_info.wsType)=="table" then
lvl2 = weapon_info.wsType[2]
lvl2 = weapon_info.wsType[2]
end
end
local ret = {
local ret = {
category = weapon_info.category,
category = weapon_info.category,
CLSID = clsid,
CLSID = clsid,
Picture = weapon_info.picture,
Picture = weapon_info.picture,
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
Cx_pil = 0.0005,
Cx_pil = 0.0005,
Elements = { }
Elements = { }
}
}
if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
if type(weapon_info.wsType)=="string" then
if type(weapon_info.wsType)=="string" then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU42",IsAdapter = true}
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU42",IsAdapter = true}
local sz = 0
local sz = 0
if left then
if left then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_LEFT"}
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_LEFT"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if right then
if right then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_RIGHT"}
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_RIGHT"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if bottom then
if bottom then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_LOWER"}
ret.Elements[#ret.Elements + 1] = {ShapeName = weapon_info.ShapeName, connector_name = "BRU-42_LOWER"}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end


ret.Count = sz
ret.Count = sz
ret.Weight = bru_42_mass + sz * weapon_info.mass
ret.Weight = bru_42_mass + sz * weapon_info.mass


ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx
ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx


if sz > 1 then
if sz > 1 then
ret.displayName = sz.." "..weapon_info.name
ret.displayName = sz.." "..weapon_info.name
else
else
ret.displayName = weapon_info.name
ret.displayName = weapon_info.name
end
end
declare_loadout(ret)
declare_loadout(ret)
return ret
return ret
end
end


local function mak79_4x_weapon(clsid,weapon_info,clampvariant,frontleft,frontright,rearleft,rearright,attach_offset)
local function mak79_4x_weapon(clsid,weapon_info,clampvariant,frontleft,frontright,rearleft,rearright,attach_offset)
--[[
--[[
clampvariants:
clampvariants:
1: outer pairs of clamps on pallet
1: outer pairs of clamps on pallet
rear |-- *----* --> front
rear |-- *----* --> front
*----*
*----*
2: inner pairs of clamps on pallet
2: inner pairs of clamps on pallet
-*--*-
-*--*-
-*--*-
-*--*-
3: front outer rear inner clamps
3: front outer rear inner clamps
-*---*
-*---*
-*---*
-*---*
4: front inner rear outer clamps
4: front inner rear outer clamps
*---*-
*---*-
*---*-
*---*-
--]]
--]]
local mak_79_mass = 10 -- TODO: find good value for this adapter
local mak_79_mass = 10 -- TODO: find good value for this adapter
local ret = {
local ret = {
category = weapon_info.category,
category = weapon_info.category,
CLSID = clsid,
CLSID = clsid,
Picture = weapon_info.picture,
Picture = weapon_info.picture,
attribute = {wsType_Weapon, weapon_info.level2, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = {wsType_Weapon, weapon_info.level2, wsType_Container, WSTYPE_PLACEHOLDER},
Cx_pil = 0.00001, -- TODO: what is reasonable?
Cx_pil = 0.00001, -- TODO: what is reasonable?
Elements = { }
Elements = { }
}
}


if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
if type(weapon_info.wsType)=="table" and weapon_info.wsType[4] ~= nil then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
if type(weapon_info.wsType)=="string" then
if type(weapon_info.wsType)=="string" then
ret.wsTypeOfWeapon = weapon_info.wsType
ret.wsTypeOfWeapon = weapon_info.wsType
end
end
ret.Elements[#ret.Elements + 1] = { ShapeName = "MAK-79_VAR_"..clampvariant, IsAdapter = true }
ret.Elements[#ret.Elements + 1] = { ShapeName = "MAK-79_VAR_"..clampvariant, IsAdapter = true }
local sz = 0
local sz = 0
if frontleft then
if frontleft then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "F_L", use_full_connector_position = true}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "F_L", use_full_connector_position = true}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if frontright then
if frontright then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "F_R", use_full_connector_position = true}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "F_R", use_full_connector_position = true}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if rearleft then
if rearleft then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "R_L", use_full_connector_position = true}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "R_L", use_full_connector_position = true}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end
if rearright then
if rearright then
sz = sz + 1
sz = sz + 1
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "R_R", use_full_connector_position = true}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = weapon_info.payload_CLSID, connector_name = "R_R", use_full_connector_position = true}
if (attach_offset ~= nil) then
if (attach_offset ~= nil) then
ret.Elements[#ret.Elements].attach_point_position = attach_offset
ret.Elements[#ret.Elements].attach_point_position = attach_offset
end
end
end
end


ret.Count = sz
ret.Count = sz
ret.Weight = sz * mak_79_mass + sz * weapon_info.mass
ret.Weight = sz * mak_79_mass + sz * weapon_info.mass


ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx
ret.Cx_pil = ret.Cx_pil + sz * weapon_info.Cx


if sz > 1 then
if sz > 1 then
ret.displayName = "MAK79 "..sz.." "..weapon_info.name
ret.displayName = "MAK79 "..sz.." "..weapon_info.name
else
else
ret.displayName = "MAK79 "..weapon_info.name
ret.displayName = "MAK79 "..weapon_info.name
end
end
declare_loadout(ret)
declare_loadout(ret)
return ret
return ret
end
end


local function bru_32_nested(clsid,nested_loadout)
local function bru_32_nested(clsid,nested_loadout)
local adu_703_bru_32_mass = 57.38
local adu_703_bru_32_mass = 57.38


local lvl2 = wsType_Missile
local lvl2 = wsType_Missile
if type(nested_loadout.attribute)=="table" then
if type(nested_loadout.attribute)=="table" then
lvl2 = nested_loadout.attribute[2]
lvl2 = nested_loadout.attribute[2]
end
end
local ret = {
local ret = {
category = nested_loadout.category,
category = nested_loadout.category,
CLSID = clsid,
CLSID = clsid,
Picture = nested_loadout.Picture,
Picture = nested_loadout.Picture,
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = {wsType_Weapon, lvl2, wsType_Container, WSTYPE_PLACEHOLDER},
Cx_pil = 0.00002, -- TODO: what is reasonable?
Cx_pil = 0.00002, -- TODO: what is reasonable?
JettisonSubmunitionOnly = true,
JettisonSubmunitionOnly = true,
Elements = {
Elements = {
}
}
}
}
if nested_loadout.wsTypeOfWeapon ~= nil then
if nested_loadout.wsTypeOfWeapon ~= nil then
ret.wsTypeOfWeapon = nested_loadout.wsTypeOfWeapon
ret.wsTypeOfWeapon = nested_loadout.wsTypeOfWeapon
end
end
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU34", IsAdapter = true }
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_BRU34", IsAdapter = true }
ret.Elements[#ret.Elements + 1] = {payload_CLSID = nested_loadout.CLSID, connector_name = "WEP_BRU-34_BRU-42"}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = nested_loadout.CLSID, connector_name = "WEP_BRU-34_BRU-42"}
ret.Count = nested_loadout.Count
ret.Count = nested_loadout.Count
ret.Weight = adu_703_bru_32_mass + nested_loadout.Weight
ret.Weight = adu_703_bru_32_mass + nested_loadout.Weight


ret.Cx_pil = ret.Cx_pil + nested_loadout.Cx_pil
ret.Cx_pil = ret.Cx_pil + nested_loadout.Cx_pil


--ret.displayName = _("BRU-32 ")..nested_loadout.displayName
--ret.displayName = _("BRU-32 ")..nested_loadout.displayName
ret.displayName = nested_loadout.displayName
ret.displayName = nested_loadout.displayName
declare_loadout(ret)
declare_loadout(ret)
return ret
return ret
end
end


local function phx_adapter_nested(clsid,nested_loadout)
local function phx_adapter_nested(clsid,nested_loadout)
local phx_adapter_mass = 0 -- TODO
local phx_adapter_mass = 0 -- TODO
local ret = {
local ret = {
category = nested_loadout.category,
category = nested_loadout.category,
CLSID = clsid,
CLSID = clsid,
Picture = nested_loadout.Picture,
Picture = nested_loadout.Picture,
attribute = {wsType_Weapon, nested_loadout.attribute[2], wsType_Container, WSTYPE_PLACEHOLDER},
attribute = {wsType_Weapon, nested_loadout.attribute[2], wsType_Container, WSTYPE_PLACEHOLDER},
Cx_pil = 0.0001, -- TODO: what is reasonable?
Cx_pil = 0.0001, -- TODO: what is reasonable?
JettisonSubmunitionOnly = true,
JettisonSubmunitionOnly = true,
Elements = {
Elements = {
}
}
}
}
if nested_loadout.wsTypeOfWeapon ~= nil then
if nested_loadout.wsTypeOfWeapon ~= nil then
ret.wsTypeOfWeapon = nested_loadout.wsTypeOfWeapon
ret.wsTypeOfWeapon = nested_loadout.wsTypeOfWeapon
end
end
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_SHOULDER_PHX_L", IsAdapter = true }
ret.Elements[#ret.Elements + 1] = { ShapeName = "HB_F14_EXT_SHOULDER_PHX_L", IsAdapter = true }
ret.Elements[#ret.Elements + 1] = {payload_CLSID = nested_loadout.CLSID, connector_name = "WEP_Phoenix_Connector"}
ret.Elements[#ret.Elements + 1] = {payload_CLSID = nested_loadout.CLSID, connector_name = "WEP_Phoenix_Connector"}
ret.Count = nested_loadout.Count
ret.Count = nested_loadout.Count
ret.Weight = phx_adapter_mass + nested_loadout.Weight
ret.Weight = phx_adapter_mass + nested_loadout.Weight




ret.Cx_pil = ret.Cx_pil + nested_loadout.Cx_pil
ret.Cx_pil = ret.Cx_pil + nested_loadout.Cx_pil


--ret.displayName = _("PHX ")..nested_loadout.displayName
--ret.displayName = _("PHX ")..nested_loadout.displayName
ret.displayName = nested_loadout.displayName
ret.displayName = nested_loadout.displayName
declare_loadout(ret)
declare_loadout(ret)
return ret
return ret
end
end


--------- MISSILES ---------
--------- MISSILES ---------
----------------------------------------------
----------------------------------------------


function make_aim_54(missile, motor, smokey)
function make_aim_54(missile, motor, smokey)


local shape_name = "AIM-54"..missile.name.."_"..motor.name
local shape_name = "AIM-54"..missile.name.."_"..motor.name
local username = "AIM-54"..missile.name.."-"..motor.name
local username = "AIM-54"..missile.name.."-"..motor.name


-- accounts for the mk47 mod0 or mod1
-- accounts for the mk47 mod0 or mod1
local smoke = {1, 1, 1, 1}
local smoke = {1, 1, 1, 1}
if smokey ~= nil and smokey == false then
if smokey ~= nil and smokey == false then
smoke = {0.8, 0.8, 0.8, 0.05 }
smoke = {0.8, 0.8, 0.8, 0.05 }
end
end


local weapon = {
local weapon = {
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
name = "AIM_54".. missile.name .."_"..motor.name,
name = "AIM_54".. missile.name .."_"..motor.name,
user_name = _(username),
user_name = _(username),
wsTypeOfWeapon = {wsType_Weapon,wsType_Missile,wsType_AA_Missile,WSTYPE_PLACEHOLDER},
wsTypeOfWeapon = {wsType_Weapon,wsType_Missile,wsType_AA_Missile,WSTYPE_PLACEHOLDER},
--class_name = "wAmmunitionPhoenix",
--class_name = "wAmmunitionPhoenix",
shape_table_data =
shape_table_data =
{
{
{
{
name = shape_name;
name = shape_name;
file = missile.model_name;
file = missile.model_name;
life = 1;
life = 1;
fire = { 0, 1};
fire = { 0, 1};
username = username;
username = username;
index = WSTYPE_PLACEHOLDER,
index = WSTYPE_PLACEHOLDER,
},
},
},
},




Escort = 0,
Escort = 0,
Head_Type = 2,
Head_Type = 2,
sigma = {5, 5, 5},
sigma = {5, 5, 5},
M = missile.mass + motor.propellant_mass,
M = missile.mass + motor.propellant_mass,
H_max = 20000.0,
H_max = 20000.0,
H_min = 1.0,
H_min = 1.0,
Diam = 380.0,
Diam = 380.0,
Cx_pil = 5,
Cx_pil = 5,
D_max = 14000.0,
D_max = 14000.0,
D_min = 700.0,
D_min = 700.0,
Head_Form = 1,
Head_Form = 1,
Life_Time = 200.0,
Life_Time = 200.0,
Nr_max = 18,
Nr_max = 18,
v_min = 140.0,
v_min = 140.0,
v_mid = 700.0,
v_mid = 700.0,
Mach_max = 4.0,
Mach_max = 4.0,
t_b = 0.0,
t_b = 0.0,
t_acc = 3.0,
t_acc = 3.0,
t_marsh = 5.0,
t_marsh = 5.0,
Range_max = 180000.0,
Range_max = 180000.0,
H_min_t = 3.0,
H_min_t = 3.0,
Fi_start = 0.5,
Fi_start = 0.5,
Fi_rak = 3.14152,
Fi_rak = 3.14152,
Fi_excort = 1.05,
Fi_excort = 1.05,
Fi_search = 1.05,
Fi_search = 1.05,
OmViz_max = 0.52,
OmViz_max = 0.52,
warhead = warheads["AIM_54"],
warhead = warheads["AIM_54"],
exhaust = smoke,
exhaust = smoke,
X_back = -1.72,
X_back = -1.72,
Y_back = 0.0,
Y_back = 0.0,
Z_back = 0.0,
Z_back = 0.0,
Reflection = 0.12,
Reflection = 0.12,
KillDistance = 15.0,
KillDistance = 15.0,
ccm_k0 = missile.ccm_k0,
ccm_k0 = missile.ccm_k0,
loft = 1,
loft = 1,
hoj = missile.hoj,
hoj = missile.hoj,
go_active_by_default = missile.go_active_by_default,
go_active_by_default = missile.go_active_by_default,
active_radar_lock_dist = 18520,
active_radar_lock_dist = 18520,
PN_gain = missile.PN_gain,
PN_gain = missile.PN_gain,
loft_factor = missile.loft_factor,
loft_factor = missile.loft_factor,
supersonic_A_coef_skew = 0.295, -- наклон прямой коэффициента отвала поляры на сверхзвуке
supersonic_A_coef_skew = 0.295, -- наклон прямой коэффициента отвала поляры на сверхзвуке
nozzle_exit_area = 1e-6, -- площадь выходного сечения сопла
-- nozzle_exit_area = 1e-6, -- площадь выходного сечения сопла
nozzle_exit_area = 0.04525, -- площадь выходного сечения сопла
PN_coeffs = {
PN_coeffs = {
4,
4,
15000.0 ,1.0,
15000.0 ,1.0,
25000.0, 0.85,
25000.0, 0.85,
40000.0, 0.65,
40000.0, 0.65,
100000.0, 0.3,
100000.0, 0.3,
};
};


ModelData = { 58, -- model params count
ModelData = { 58, -- model params count
1.1, -- characteristic square (характеристическая площадь)
1.1, -- characteristic square (характеристическая площадь)
-- параметры зависимости Сx
-- параметры зависимости Сx
0.042 , -- Cx_k0 планка Сx0 на дозвуке ( M << 1)
0.042 , -- Cx_k0 планка Сx0 на дозвуке ( M << 1)
0.083 , -- Cx_k1 высота пика волнового кризиса
0.083 , -- Cx_k1 высота пика волнового кризиса
0.01 , -- Cx_k2 крутизна фронта на подходе к волновому кризису
0.01 , -- Cx_k2 крутизна фронта на подходе к волновому кризису
-0.24, -- Cx_k3 планка Cx0 на сверхзвуке ( M >> 1)
-0.24, -- Cx_k3 планка Cx0 на сверхзвуке ( M >> 1)
0.12 , -- Cx_k4 крутизна спада за волновым кризисом
0.12 , -- Cx_k4 крутизна спада за волновым кризисом
0.18 , -- коэффициент отвала поляры (пропорционально sqrt (M^2-1))
0.18 , -- коэффициент отвала поляры (пропорционально sqrt (M^2-1))
-- параметры зависимости Cy
-- параметры зависимости Cy
1.6 , -- Cy_k0 планка Сy0 на дозвуке ( M << 1)
1.6 , -- Cy_k0 планка Сy0 на дозвуке ( M << 1)
1.3 , -- Cy_k1 планка Cy0 на сверхзвуке ( M >> 1)
1.3 , -- Cy_k1 планка Cy0 на сверхзвуке ( M >> 1)
1.2 , -- Cy_k2 крутизна спада(фронта) за волновым кризисом
1.2 , -- Cy_k2 крутизна спада(фронта) за волновым кризисом
0.35, -- 7 Alfa_max максимальный балансировачный угол, радианы
0.35, -- 7 Alfa_max максимальный балансировачный угол, радианы
0.0, --угловая скорость создаваймая моментом газовых рулей
0.0, --угловая скорость создаваймая моментом газовых рулей
-- Engine data. Time, fuel flow, thrust.
-- Engine data. Time, fuel flow, thrust.
-- t_statr t_b t_accel t_march t_inertial t_break t_end -- Stage
-- t_statr t_b t_accel t_march t_inertial t_break t_end -- Stage
0.27, -1.0, motor.burn_time, 0.1, 0.0, 0.0, 1.0e9, -- time of stage, sec
0.27, -1.0, motor.burn_time, 0.1, 0.0, 0.0, 1.0e9, -- time of stage, sec
0.0, 0.0, motor.propellant_mass / motor.burn_time, 0.0, 0.0, 0.0, 0.0, -- fuel flow rate in second, kg/sec(секундный расход массы топлива кг/сек)
0.0, 0.0, motor.propellant_mass / motor.burn_time, 0.0, 0.0, 0.0, 0.0, -- fuel flow rate in second, kg/sec(секундный расход массы топлива кг/сек)
0.0, 0.0, motor.thrust, 0.0, 0.0, 0.0, 0.0, -- thrust, newtons
0.0, 0.0, motor.thrust, 0.0, 0.0, 0.0, 0.0, -- thrust, newtons
1.0e9, -- таймер самоликвидации, сек
1.0e9, -- таймер самоликвидации, сек
200.0, -- время работы энергосистемы, сек
200.0, -- время работы энергосистемы, сек
0, -- абсолютная высота самоликвидации, м
0, -- абсолютная высота самоликвидации, м
2.5, -- время задержки включения управления (маневр отлета, безопасности), сек
2.5, -- время задержки включения управления (маневр отлета, безопасности), сек
40000.0, -- дальность до цели в момент пуска, при превышении которой ракета выполняется маневр "горка", м
40000.0, -- дальность до цели в момент пуска, при превышении которой ракета выполняется маневр "горка", м
30000.0, -- дальность до цели, при которой маневр "горка" завершается и ракета переходит на чистую пропорциональную навигацию (должен быть больше или равен предыдущему параметру), м
30000.0, -- дальность до цели, при которой маневр "горка" завершается и ракета переходит на чистую пропорциональную навигацию (должен быть больше или равен предыдущему параметру), м
missile.loft_angle, -- синус угла возвышения траектории набора горки
missile.loft_angle, -- синус угла возвышения траектории набора горки
30.0, -- продольное ускорения взведения взрывателя
30.0, -- продольное ускорения взведения взрывателя
0.0, -- модуль скорости сообщаймый катапультным устройством, вышибным зарядом и тд
0.0, -- модуль скорости сообщаймый катапультным устройством, вышибным зарядом и тд
missile.guidance.k0, -- характеристика системы САУ-РАКЕТА, коэф фильтра второго порядка K0
missile.guidance.k0, -- характеристика системы САУ-РАКЕТА, коэф фильтра второго порядка K0
missile.guidance.k1, -- характеристика системы САУ-РАКЕТА, коэф фильтра второго порядка K1
missile.guidance.k1, -- характеристика системы САУ-РАКЕТА, коэф фильтра второго порядка K1
missile.guidance.w_cutoff, -- характеристика системы САУ-РАКЕТА, полоса пропускания контура управления
missile.guidance.w_cutoff, -- характеристика системы САУ-РАКЕТА, полоса пропускания контура управления


-- DLZ data. Use numbers below for your implemetation. --From Denis Alekseev
-- DLZ data. Use numbers below for your implemetation. --From Denis Alekseev
-- ЗРП. Данные для рассчета дальностей пуска (индикация на прицеле)
-- ЗРП. Данные для рассчета дальностей пуска (индикация на прицеле)
50.0, -- производная дальности по скорости носителя на высоте 1км, ППС
50.0, -- производная дальности по скорости носителя на высоте 1км, ППС
-45.0, -- производная дальности по скорости цели на высоте 1км, ЗПС
-45.0, -- производная дальности по скорости цели на высоте 1км, ЗПС
-7.2, -- производная по высоте производной дальности по скорости цели, ЗПС
-7.2, -- производная по высоте производной дальности по скорости цели, ЗПС
72000.0, -- дальность ракурс 180 град(навстречу), Н=5000м, V=900км/ч, м
72000.0, -- дальность ракурс 180 град(навстречу), Н=5000м, V=900км/ч, м
28000.0, -- дальность ракурс 180(в догон) град, Н=5000м, V=900км/ч, м
28000.0, -- дальность ракурс 180(в догон) град, Н=5000м, V=900км/ч, м
120000.0, -- дальность ракурс 180(навстречу) град, Н=10000м, V=900км/ч, м
120000.0, -- дальность ракурс 180(навстречу) град, Н=10000м, V=900км/ч, м
46000.0, -- дальность ракурс 0(в догон) град, Н=10000м, V=900км/ч, м
46000.0, -- дальность ракурс 0(в догон) град, Н=10000м, V=900км/ч, м
44000.0, -- дальность ракурс 180 град, Н=1000м, V=900км/ч, м
44000.0, -- дальность ракурс 180 град, Н=1000м, V=900км/ч, м
20000.0, -- дальность ракурс 180(в догон) град, Н=1000м, V=900км/ч, м
20000.0, -- дальность ракурс 180(в догон) град, Н=1000м, V=900км/ч, м
3500.0, -- Вертикальная плоскость. Наклон кривой разрешенной дальности пуска в нижнюю полусферу. Уменьшение дальности при стрельбе вниз.
3500.0, -- Вертикальная плоскость. Наклон кривой разрешенной дальности пуска в нижнюю полусферу. Уменьшение дальности при стрельбе вниз.
0.4, -- Вертикальная плоскость. Наклон кривой разрешенной дальности пуска в верхнюю полусферу. Увеличение дальности при стрельбе вверх.
0.4, -- Вертикальная плоскость. Наклон кривой разрешенной дальности пуска в верхнюю полусферу. Увеличение дальности при стрельбе вверх.
-0.012, -- Вертикальная плоскость. Угол перегиба кривой разрешенной дальности, верхняя - нижняя полусфера.
-0.012, -- Вертикальная плоскость. Угол перегиба кривой разрешенной дальности, верхняя - нижняя полусфера.
0.7, -- Изменение коэффициентов наклона кривой в верхнюю и нижнюю полусферы от высоты носителя
0.7, -- Изменение коэффициентов наклона кривой в верхнюю и нижнюю полусферы от высоты носителя
},
},
}
}


return weapon
return weapon
end
end
-- Common missile properties
-- Common missile properties
local AIM_54A_missile_properties = {
local AIM_54A_missile_properties = {
name = "A",
name = "A",
model_name = "HB_F14_EXT_AIM54_A",
model_name = "HB_F14_EXT_AIM54_A",
mass = 281.0,
mass = 281.0,
PN_gain = 5,
PN_gain = 5,
loft_factor = 35.0,
loft_factor = 35.0,
loft_angle = 0.17, --this is sin(loft_angle)
loft_angle = 0.17, --this is sin(loft_angle)
go_active_by_default = 0,
go_active_by_default = 0,
hoj = 0,
hoj = 0,
ccm_k0 = 1.0,
ccm_k0 = 1.0,
guidance = {
guidance = {
k0 = 36.0,
k0 = 36.0,
k1 = 7.8,
k1 = 7.8,
w_cutoff = 1.0,
w_cutoff = 1.0,
},
},
}
}


local AIM_54C_missile_properties = {
local AIM_54C_missile_properties = {
name = "C",
name = "C",
model_name = "HB_F14_EXT_AIM54",
model_name = "HB_F14_EXT_AIM54",
mass = 291.0,
mass = 291.0,
PN_gain = 5,
PN_gain = 5,
loft_factor = 35.0,
loft_factor = 35.0,
loft_angle = 0.17, --this is sin(loft_angle)
loft_angle = 0.17, --this is sin(loft_angle)
go_active_by_default = 1,
go_active_by_default = 1,
hoj = 1,
hoj = 1,
ccm_k0 = 0.2,
ccm_k0 = 0.2,
guidance = {
guidance = {
k0 = 36.0,
k0 = 36.0,
k1 = 7.8,
k1 = 7.8,
w_cutoff = 1.0,
w_cutoff = 1.0,
},
},
}
}


local MK47_motor_properties = {
local MK47_motor_properties = {
name = "Mk47",
name = "Mk47",
propellant_mass = 163.0,
propellant_mass = 163.0,
burn_time = 27.0,
burn_time = 27.0,
thrust = 13595.0,
thrust = 13595.0,
}
}


local MK60_motor_properties = {
local MK60_motor_properties = {
name = "Mk60",
name = "Mk60",
propellant_mass = 163.0,
propellant_mass = 163.0,
burn_time = 20.6,
burn_time = 20.6,
thrust = 17793.0,
thrust = 17793.0,
}
}




local AIM_54A_Mk47 = make_aim_54(AIM_54A_missile_properties, MK47_motor_properties)
local AIM_54A_Mk47 = make_aim_54(AIM_54A_missile_properties, MK47_motor_properties)
local AIM_54A_Mk60 = make_aim_54(AIM_54A_missile_properties, MK60_motor_properties)
local AIM_54A_Mk60 = make_aim_54(AIM_54A_missile_properties, MK60_motor_properties)


local AIM_54C_Mk47 = make_aim_54(AIM_54C_missile_properties, MK47_motor_properties, false)
local AIM_54C_Mk47 = make_aim_54(AIM_54C_missile_properties, MK47_motor_properties, false)
local AIM_54C_Mk60 = make_aim_54(AIM_54C_missile_properties, MK60_motor_properties)
local AIM_54C_Mk60 = make_aim_54(AIM_54C_missile_properties, MK60_motor_properties)


declare_weapon(AIM_54A_Mk47)
declare_weapon(AIM_54A_Mk47)
declare_weapon(AIM_54A_Mk60)
declare_weapon(AIM_54A_Mk60)
declare_weapon(AIM_54C_Mk47)
declare_weapon(AIM_54C_Mk47)
declare_weapon(AIM_54C_Mk60)
declare_weapon(AIM_54C_Mk60)


declare_loadout({ -- AIM-54A Mk47
declare_loadout({ -- AIM-54A Mk47
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
CLSID = "{AIM_54A_Mk47}",
CLSID = "{AIM_54A_Mk47}",
Picture = "aim54.png",
Picture = "aim54.png",
--wsTypeOfWeapon = AIM_54A_Mk47.wsTypeOfWeapon,
--wsTypeOfWeapon = AIM_54A_Mk47.wsTypeOfWeapon,
displayName = AIM_54A_Mk47.user_name,
displayName = AIM_54A_Mk47.user_name,
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = AIM_54A_Mk47.wsTypeOfWeapon,
attribute = AIM_54A_Mk47.wsTypeOfWeapon,
Cx_pil = AIM_54A_Mk47.Cx_pil / 4096.0,
Cx_pil = AIM_54A_Mk47.Cx_pil / 4096.0,
Count = 1,
Count = 1,
Weight = AIM_54A_Mk47.M,
Weight = AIM_54A_Mk47.M,
Elements =
Elements =
{
{
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
{
{
DrawArgs =
DrawArgs =
{
{
[1] = {1, 1},
[1] = {1, 1},
[2] = {2, 1},
[2] = {2, 1},
}, -- end of DrawArgs
}, -- end of DrawArgs
--Position = {0, 0, 0},
--Position = {0, 0, 0},
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
ShapeName = "AIM-54A_Mk47",
ShapeName = "AIM-54A_Mk47",
},
},
}, -- end of Elements
}, -- end of Elements
})
})


declare_loadout({ -- AIM-54A Mk60
declare_loadout({ -- AIM-54A Mk60
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
CLSID = "{AIM_54A_Mk60}",
CLSID = "{AIM_54A_Mk60}",
Picture = "aim54.png",
Picture = "aim54.png",
--wsTypeOfWeapon = AIM_54A_Mk60.wsTypeOfWeapon,
--wsTypeOfWeapon = AIM_54A_Mk60.wsTypeOfWeapon,
displayName = AIM_54A_Mk60.user_name,
displayName = AIM_54A_Mk60.user_name,
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = AIM_54A_Mk60.wsTypeOfWeapon,
attribute = AIM_54A_Mk60.wsTypeOfWeapon,
Cx_pil = AIM_54A_Mk60.Cx_pil / 4096.0,
Cx_pil = AIM_54A_Mk60.Cx_pil / 4096.0,
Count = 1,
Count = 1,
Weight = AIM_54A_Mk60.M,
Weight = AIM_54A_Mk60.M,
Elements =
Elements =
{
{
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
{
{
DrawArgs =
DrawArgs =
{
{
[1] = {1, 1},
[1] = {1, 1},
[2] = {2, 1},
[2] = {2, 1},
}, -- end of DrawArgs
}, -- end of DrawArgs
--Position = {0, 0, 0},
--Position = {0, 0, 0},
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
ShapeName = "AIM-54A_M60",
ShapeName = "AIM-54A_M60",
},
},
}, -- end of Elements
}, -- end of Elements
})
})


declare_loadout({ -- AIM-54C Mk47
declare_loadout({ -- AIM-54C Mk47
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
CLSID = "{AIM_54C_Mk47}",
CLSID = "{AIM_54C_Mk47}",
Picture = "aim54.png",
Picture = "aim54.png",
--wsTypeOfWeapon = AIM_54C_Mk47.wsTypeOfWeapon,
--wsTypeOfWeapon = AIM_54C_Mk47.wsTypeOfWeapon,
displayName = AIM_54C_Mk47.user_name,
displayName = AIM_54C_Mk47.user_name,
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = AIM_54C_Mk47.wsTypeOfWeapon,
attribute = AIM_54C_Mk47.wsTypeOfWeapon,
Cx_pil = AIM_54C_Mk47.Cx_pil / 4096.0,
Cx_pil = AIM_54C_Mk47.Cx_pil / 4096.0,
Count = 1,
Count = 1,
Weight = AIM_54C_Mk47.M,
Weight = AIM_54C_Mk47.M,
Elements =
Elements =
{
{
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
{
{
DrawArgs =
DrawArgs =
{
{
[1] = {1, 1},
[1] = {1, 1},
[2] = {2, 1},
[2] = {2, 1},
}, -- end of DrawArgs
}, -- end of DrawArgs
--Position = {0, -0.5, 0},
--Position = {0, -0.5, 0},
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
ShapeName = "AIM-54C_M47",
ShapeName = "AIM-54C_M47",
},
},
}, -- end of Elements
}, -- end of Elements
})
})


declare_loadout({ -- AIM-54C Mk47
declare_loadout({ -- AIM-54C Mk47
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
CLSID = "{AIM_54C_Mk60}",
CLSID = "{AIM_54C_Mk60}",
Picture = "aim54.png",
Picture = "aim54.png",
--wsTypeOfWeapon = AIM_54C_Mk47.wsTypeOfWeapon,
--wsTypeOfWeapon = AIM_54C_Mk47.wsTypeOfWeapon,
displayName = AIM_54C_Mk60.user_name,
displayName = AIM_54C_Mk60.user_name,
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
--attribute = {wsType_Weapon, wsType_Missile, wsType_Container, WSTYPE_PLACEHOLDER},
attribute = AIM_54C_Mk60.wsTypeOfWeapon,
attribute = AIM_54C_Mk60.wsTypeOfWeapon,
Cx_pil = AIM_54C_Mk60.Cx_pil / 4096.0,
Cx_pil = AIM_54C_Mk60.Cx_pil / 4096.0,
Count = 1,
Count = 1,
Weight = AIM_54C_Mk60.M,
Weight = AIM_54C_Mk60.M,
Elements =
Elements =
{
{
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
--{ ShapeName = "HB_F14_EXT_PHX_ALU" , IsAdapter = true },
{
{
DrawArgs =
DrawArgs =
{
{
[1] = {1, 1},
[1] = {1, 1},
[2] = {2, 1},
[2] = {2, 1},
}, -- end of DrawArgs
}, -- end of DrawArgs
--Position = {0, -0.5, 0},
--Position = {0, -0.5, 0},
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
--connector_name = "WEP_Phoenix_FrontPallette_L_ALU",
ShapeName = "AIM-54C_M60",
ShapeName = "AIM-54C_M60",
},
},
}, -- end of Elements
}, -- end of Elements
})
})


local function shoulder_aim_54(clsid, element, elem_CLSID, side) -- side L or R
local function shoulder_aim_54(clsid, element, elem_CLSID, side) -- side L or R
local ret = {
local ret = {
category = CAT_AIR_TO_AIR,
category = CAT_AIR_TO_AIR,
CLSID = clsid,
CLSID = clsid,
Picture = "aim54.png",
Picture = "aim54.png",
wsTypeOfWeapon = element.wsTypeOfWeapon,
wsTypeOfWeapon = element.wsTypeOfWeapon,
attribute = {4, 4, 32, WSTYPE_PLACEHOLDER},
attribute = {4, 4, 32, WSTYPE_PLACEHOLDER},
Cx_pil = 1.25 * (element.Cx_pil/4096.0),
Cx_pil = 1.25 * (element.Cx_pil/4096.0),
-- per F-14 perf manual:
-- per F-14 perf manual:
-- shoulder AIM54 drag index = 12
-- shoulder AIM54 drag index = 12
-- AIM54 shoulder adapter index = 3
-- AIM54 shoulder adapter index = 3
-- total drag index = 15, add 25% more drag to shoulder AIM54
-- total drag index = 15, add 25% more drag to shoulder AIM54
Count = 1,
Count = 1,
Weight = element.M + 45.36, --100lbs for LAU-93
Weight = element.M + 45.36, --100lbs for LAU-93
JettisonSubmunitionOnly = true,
JettisonSubmunitionOnly = true,
Elements =
Elements =
{
{
{ ShapeName = "HB_F14_EXT_SHOULDER_PHX_"..side , IsAdapter = true },
{ ShapeName = "HB_F14_EXT_SHOULDER_PHX_"..side , IsAdapter = true },
{ payload_CLSID = elem_CLSID , connector_name = "WEP_Phoenix_Connector"}
{ payload_CLSID = elem_CLSID , connector_name = "WEP_Phoenix_Connector"}
}-- end of Elements
}-- end of Elements
}
}
-- actually a LAU-93 adapter, the LAU-93 is internal to the adapter (and the rails also have LAU-93)
-- actually a LAU-93 adapter, the LAU-93 is internal to the adapter (and the rails also have LAU-93)
--ret.displayName = _("LAU-93 ").." "..element.name
--ret.displayName = _("LAU-93 ").." "..element.name
--ret.displayName = element.name
--ret.displayName = element.name
ret.displayName = element.user_name
ret.displayName = element.user_name
declare_loadout(ret)
declare_loadout(ret)
end
end


-- shoulder phoenix stations
-- shoulder phoenix stations
shoulder_aim_54("{SHOULDER AIM_54C_Mk60 L}", AIM_54C_Mk60, "{AIM_54C_Mk60}", "L")
shoulder_aim_54("{SHOULDER AIM_54C_Mk60 L}", AIM_54C_Mk60, "{AIM_54C_Mk60}", "L")
shoulder_aim_54("{SHOULDER AIM_54C_Mk60 R}", AIM_54C_Mk60, "{AIM_54C_Mk60}", "R")
shoulder_aim_54("{SHOULDER AIM_54C_Mk60 R}", AIM_54C_Mk60, "{AIM_54C_Mk60}", "R")
shoulder_aim_54("{SHOULDER AIM_54C_Mk47 L}", AIM_54C_Mk47, "{AIM_54C_Mk47}", "L")
shoulder_aim_54("{SHOULDER AIM_54C_Mk47 L}", AIM_54C_Mk47, "{AIM_54C_Mk47}", "L")
shoulder_aim_54("{SHOULDER AIM_54C_Mk47 R}", AIM_54C_Mk47, "{AIM_54C_Mk47}", "R")
shoulder_aim_54("{SHOULDER AIM_54C_Mk47 R}", AIM_54C_Mk47, "{AIM_54C_Mk47}", "R")
shoulder_aim_54("{SHOULDER AIM_54A_Mk60 L}", AIM_54A_Mk60, "{AIM_54A_Mk60}", "L")
shoulder_aim_54("{SHOULDER AIM_54A_Mk60 L}", AIM_54A_Mk60, "{AIM_54A_Mk60}", "L")
shoulder_aim_54("{SHOULDER AIM_54A_Mk60 R}", AIM_54A_Mk60, "{AIM_54A_Mk60}", "R")
shoulder_aim_54("{SHOULDER AIM_54A_Mk60 R}", AIM_54A_Mk60, "{AIM_54A_Mk60}", "R")
shoulder_aim_54("{SHOULDER AIM_54A_Mk47 L}", AIM_54A_Mk47, "{AIM_54A_Mk47}", "L")
shoulder_aim_54("{SHOULDER AIM_54A_Mk47 L}", AIM_54A_Mk47, "{AIM_54A_Mk47}", "L")
shoulder_aim_54("{SHOULDER AIM_54A_Mk47 R}", AIM_54A_Mk47, "{AIM_54A_Mk47}", "R")
shoulder_aim_54("{SHOULDER AIM_54A_Mk47 R}", AIM_54A_Mk47, "{AIM_54A_Mk47}", "R")


----- sidewinders
----- sidewinders
-- from aim9_family.lua
-- from aim9_family.lua




local aim9_variants =
local aim9_variants =
{
{
["AIM-9"] = {picture = "us_AIM-9L.png", display_name = _("AIM-9M") ,wstype = {4, 4, 7 , AIM_9 }, category = CAT_AIR_TO_AIR, mass = 86.64 },
["AIM-9"] = {picture = "us_AIM-9L.png", display_name = _("AIM-9M") ,wstype = {4, 4, 7 , AIM_9 }, category = CAT_AIR_TO_AIR, mass = 86.64 },
["AIM-9P"] = {picture = "us_AIM-9P.png", display_name = _("AIM-9P") ,wstype = {4, 4, 7 , AIM_9P}, category = CAT_AIR_TO_AIR, mass = 86.18 },
["AIM-9P"] = {picture = "us_AIM-9P.png", display_name = _("AIM-9P") ,wstype = {4, 4, 7 , AIM_9P}, category = CAT_AIR_TO_AIR, mass = 86.18 },
["AIM-9L"] = {picture = "us_AIM-9L.png", display_name = _("AIM-9L"), wstype = "weapons.missiles.AIM-9L", category = CAT_AIR_TO_AIR },
["AIM-9L"] = {picture = "us_AIM-9L.png", display_name = _("AIM-9L"), wstype = "weapons.missiles.AIM-9L", category = CAT_AIR_TO_AIR },
["ais-pod-t50_l"] = {picture = "ais-pod-t50_l.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
["ais-pod-t50_l"] = {picture = "ais-pod-t50_l.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
["ais-pod-t50_r"] = {picture = "ais-pod-t50_r.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
["ais-pod-t50_r"] = {picture = "ais-pod-t50_r.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
["ais-pod-t50_d"] = {picture = "ais-pod-t50_d.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
["ais-pod-t50_d"] = {picture = "ais-pod-t50_d.png", display_name = _("AN/ASQ-T50 TCTS Pod - ACMI Pod") ,wstype = {4, 15, 47 , 108}, category = CAT_PODS, mass = 62.6 },
}
}


local function aim_9_with_adapter(CLSID,aim_9_variant)
local function aim_9_with_adapter(CLSID,aim_9_variant)
local var = aim9_variants[aim_9_variant] or aim9_variants["AIM-9"]
local var = aim9_variants[aim_9_variant] or aim9_variants["AIM-9"]
local var_mass = var.mass or 85.5
local var_mass = var.mass or 85.5
local name_prefix = "LAU-7 "
local name_prefix = "LAU-7 "
local pic = var.picture or "aim9p.png"
local pic = var.picture or "aim9p.png"
declare_loadout({
declare_loadout({
category = var.category,
category = var.category,
CLSID = CLSID,
CLSID = CLSID,
Picture = pic,
Picture = pic,
displayName = name_prefix..var.display_name,
displayName = name_prefix..var.display_name,
wsTypeOfWeapon = var.wstype,
wsTypeOfWeapon = var.wstype,
attribute = {4, 4, 32, 111},
attribute = {4, 4, 32, 111},
Cx_pil = 1.125*(2.58 / 4096.0), -- 2.58 from AIM_9L.Cx_pil
Cx_pil = 1.125*(2.58 / 4096.0), -- 2.58 from AIM_9L.Cx_pil
-- per F-14 perf manual:
-- per F-14 perf manual:
-- shoulder AIM9 drag index = 8
-- shoulder AIM9 drag index = 8
-- AIM9 shoulder adapter index = 1
-- AIM9 shoulder adapter index = 1
-- total drag index = 9, add 12.5% (1/8) more drag to shoulder AIM9
-- total drag index = 9, add 12.5% (1/8) more drag to shoulder AIM9
Count = 1,
Count = 1,
Weight = 15 + var_mass,
Weight = 15 + var_mass,
JettisonSubmunitionOnly = true,
JettisonSubmunitionOnly = true,
Elements =
Elements =
{
{
{ ShapeName = "HB_F14_EXT_LAU-7" , IsAdapter = true},
{ ShapeName = "HB_F14_EXT_LAU-7" , IsAdapter = true},
{ ShapeName = aim_9_variant , connector_name = "WEP_Sidewinder_Extra"},
{ ShapeName = aim_9_variant , connector_name = "WEP_Sidewinder_Extra"},
}-- end of Elements
}-- end of Elements
})
})
end
end


local function aim_9_without_adapter(CLSID,aim_9_variant,name_prefix)
local function aim_9_without_adapter(CLSID,aim_9_variant,name_prefix)
local var = aim9_variants[aim_9_variant] or aim9_variants["AIM-9"]
local var = aim9_variants[aim_9_variant] or aim9_variants["AIM-9"]
local var_mass = var.mass or 85.5
local var_mass = var.mass or 85.5
local pic = var.picture or "aim9p.png"
local pic = var.picture or "aim9p.png"
declare_loadout({
declare_loadout({
category = var.category,
category = var.category,
CLSID = CLSID,
CLSID = CLSID,
Picture = pic,
Picture = pic,
displayName = name_prefix..var.display_name,
displayName = name_prefix..var.display_name,
attribute = var.wstype,
attribute = var.wstype,
Cx_pil = 2.58 / 4096.0, -- 2.58 from AIM_9L.Cx_pil
Cx_pil = 2.58 / 4096.0, -- 2.58
Count = 1,
Weight = var_mass,
Eleme