BlackLibrary Posted November 19, 2019 Posted November 19, 2019 Hi i would make an smokey sam. modell i have but i cant figure out how to make the missle look like the smokey missle and that he makes no damage. as base i work with the igla. the lua atached works but it makes damage. i tryed to define a weapon but i cant get it to work. can anybody help me? Model name of the missle: GTR18_projectileGTR18.lua aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server
dali Posted November 21, 2019 Posted November 21, 2019 I think this was already done, search the forum and contact the author, he might have some hints.
Robin_Hood Posted November 24, 2019 Posted November 24, 2019 Yes, you need to declare a new weapons, something like this (my custom SA-7): -- 9M32M Strela-2 MANPADS local SA9M32M = { category = CAT_MISSILES, name = "9M32M"; display_name = _("9M32M Strela-2M"), wsTypeOfWeapon = { wsType_Weapon, wsType_Missile, wsType_SA_Missile, WSTYPE_PLACEHOLDER }; shape_table_data = { { name = "9M32M"; file = "9m32m"; -- this is the 3D model filename: 9m32m.edm life = 1; fire = {0, 1}; username = "9M32M Strela-2M"; index = WSTYPE_PLACEHOLDER; } }, Escort = 0, Head_Type = 1, sigma = {5, 5, 5}, M = 9.8, H_max =2300.0, H_min = 50.0, Diam = 72.0, Cx_pil = 2, D_max = 4200.0, D_min = 800.0, Head_Form = 0, Life_Time = 17.0, Nr_max = 14, v_min = 170.0, v_mid = 250.0, Mach_max = 1.3, t_b = 0.0, t_acc = 3.0, t_marsh = 5.0, Range_max = 4200.0, H_min_t = 50.0, Fi_start = math.rad(1), Fi_rak = 3.14152, Fi_excort = 1.0, Fi_search = 99.9, OmViz_max = 99.9, warhead = { mass = 1.265, expl_mass = 1.15, other_factors = {1,1,1}, obj_factors = {1,1}, concrete_factors = {1,1,1}, cumulative_factor = 0, concrete_obj_factor = 0, cumulative_thickness = 0, caliber = 72, }, exhaust = {0.9, 0.9, 0.85, 0.9}, X_back = -0.95, Y_back = 0.0, Z_back = 0.0, Reflection = 0.04, KillDistance = 2.5, --seeker sensivity params SeekerSensivityDistance = 10000, -- The range of target with IR value = 1. In meters. SeekerCooled = false, -- True is cooled seeker and false is not cooled seeker. ccm_k0 = 1.5, -- Counter Countermeasures Probability Factor. Value = 0 - missile has absolutely resistance to countermeasures. Default = 1 (medium probability) } declare_weapon(SA9M32M); You will find the Igla definition in DCS World\Scripts\Database\Weapons\missile_data.lua Then you create the launcher, either directly or separately like that: -- 9K32 Strela-2 MANPADS Launcher GT_t.LN_t._9K32 = {} GT_t.LN_t._9K32.type = 4; GT_t.LN_t._9K32.distanceMin = 500; GT_t.LN_t._9K32.distanceMax = 5000; GT_t.LN_t._9K32.reactionTime = 3; GT_t.LN_t._9K32.launch_delay = 1; GT_t.LN_t._9K32.maxShootingSpeed = 0; GT_t.LN_t._9K32.reflection_limit = 0.22; GT_t.LN_t._9K32.ECM_K = -1 GT_t.LN_t._9K32.min_launch_angle = math.rad(-20); GT_t.LN_t._9K32.inclination_correction_upper_limit = math.rad(0); GT_t.LN_t._9K32.inclination_correction_bias = (0); GT_t.LN_t._9K32.sensor = {} set_recursive_metatable(GT_t.LN_t._9K32.sensor, GT_t.WSN_t[0]) GT_t.LN_t._9K32.PL = {} GT_t.LN_t._9K32.PL[1] = {} GT_t.LN_t._9K32.PL[1].ammo_capacity = 3; GT_t.LN_t._9K32.PL[1].reload_time = 120; GT_t.LN_t._9K32.PL[1].type_ammunition = SA9M32M.wsTypeOfWeapon; -- this is where you call the weapon you defined earlier GT_t.LN_t._9K32.PL[1].name_ammunition = SA9M32M.shape_table_data.username; -- this is where you call the weapon you defined earlier GT_t.LN_t._9K32.PL[1].automaticLoader = false GT_t.LN_t._9K32.PL[1].shot_delay = 0.01; GT_t.LN_t._9K32.BR = { { pos = {1, 0, 0}, drawArgument = 4}, } GT_t.WS_t.strela2 = {} GT_t.WS_t.strela2.pos = {-0.071, 1.623,0} GT_t.WS_t.strela2.angles = { {math.rad(180), math.rad(-180), math.rad(-45), math.rad(80)}, }; GT_t.WS_t.strela2.drawArgument1 = 0 GT_t.WS_t.strela2.drawArgument2 = 1 GT_t.WS_t.strela2.omegaY = 1.5; GT_t.WS_t.strela2.omegaZ = 1.5; GT_t.WS_t.strela2.pidY = {p=40,i=1.0,d=7, inn = 5}; GT_t.WS_t.strela2.pidZ = {p=40,i=1.0,d=7, inn = 5}; GT_t.WS_t.strela2.reloadAngleY = -100 GT_t.WS_t.strela2.LN = {} GT_t.WS_t.strela2.LN[1] = {} set_recursive_metatable(GT_t.WS_t.strela2.LN[1], GT_t.LN_t._9K32) GT_t.WS_t.strela2.LN[1].PL[1].shot_delay = 20;You will find the Igla launcher definition in DCS World\Scripts\Database\scripts\missile.lua Now you can assign your launcher to your unit definition: -- weapon systems GT.WS = {}; GT.WS.maxTargetDetectionRange = 5000; GT.WS.fire_on_march = false; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; set_recursive_metatable(GT.WS[ws], GT_t.WS_t.strela2); -- here you call the launcher GT.WS[ws].pointer = "camera"; GT.WS[ws].cockpit = {"IglaSight/IglaSight", {0, 0, 0}} GT.WS[ws].LN[1].BR[1].connector_name = "POINT_LAUNCHER"; GT.WS[ws].LN[1].sightMasterMode = 1; Hope it helps ! 2nd French Fighter Squadron
Recommended Posts