Xeno426 Posted February 7, 2024 Posted February 7, 2024 I've been attempting to create several extra warhead types for the Zuni, basing it off the existing Zuni values. While the HEAT and smoke rounds work fine, I've found the illumination rounds to be confounding. So far I've got something that doesn't crash the game on startup, but other rockets on the aircraft won't fire and trying to shoot the illumination rockets crashes the game without any obvious errors in the log. Though on startup, it gives me an odd error in the logs. ALERT wInfo (Main): While loading weapons.nurs.ZUNI_MK33_OV10: Error while loading ./Scripts/Database/Weapons/schemes/rockets/nurs-light.sch: Parameter not defined: launcher.server Here's the current code I've got for the illumination rockets. local LocStr = { mm = _("mm"), PodZones = _("Pod Zones"), Type = _("Type"), UnGdRkts = _("UnGd Rkts"), HE = _("HE/FRAG"), HEAT = _("HEAT"), ILUM = _("IL"), SMKWT = _("Smk Wht"), WP = _("Wht Phos"), RP = _("Rd Phos"), SMKRD = _("Smk Rd"), MK33_name = _("Zuni MK 33 IL"), MK34Mod0_name = _("Zuni MK 34 WP"), MK34Mod2_name = _("Zuni MK 34 RP"), MK32_name = _("Zuni MK 32 ATAP"), MK33_name_sh = _("Zuni Mk.33"), MK34Mod0_name_sh = _("Zuni Mk.34Mod0"), MK34Mod2_name_sh = _("Zuni Mk.34Mod2"), MK32_name_sh = _("Zuni Mk.32"), } local LAU10_mass_empty = 47.6 local LAU10_cx = 0.001708984375 local ZuniFM = { I = 27.744, L = 2.4, Ma = 0.50851, Mw = 3.28844, caliber = 0.13, cx_coeff = { 1, 1.5, 0.68, 0.7, 1.75 }, freq = 7, mass = 57.8, rail_open = false, shapeName = "zuni", wind_sigma = 10, wind_sigma_z_coeff = 1, wind_time = 2.1, } local Mk71Mod0 = { boost_factor = 1, boost_tail = 1, boost_time = 0, fuel_mass = 24.5, impulse = 205, nozzle_orientationXYZ = { { 0, 0, 0 } }, nozzle_position = { { -1, 0, 0 } }, smoke_color = { 0.9, 0.9, 0.9 }, smoke_transparency = 0.1, tail_width = 0.13, work_tail = 1, work_time = 1.4, length = 1.94, total_mass = 36.1, } ZUNI_MK33_FLARE_XENO = { category = CAT_BOMBS, name = "ZUNI_MK33_FLARE_XENO", user_name = _("Zuni Flare"), wsTypeOfWeapon = {4, 5, 49, WSTYPE_PLACEHOLDER}, --{wsType_Weapon, wsType_Bomb, wsType_Bomb_Lighter, WSTYPE_PLACEHOLDER}, class_name = "wAmmunition_viHeavyObject", scheme = "bomb-light-2", model = "s-8_om_parashut", type = 2, mass = 3.17, hMin = 25, hMax = 2000, VyHold = -50, Ag = -5, fm = { mass = 3.17, caliber = 0.13, cx_coeff = {1, 0.39, 0.38, 0.236, 1.31}, L = 0.237, I = 1 / 12 * 3.17 * 0.237 ^ 2, Ma = 0.68, Mw = 5.6, chute_diam = 0.64, chute_Cx = 3, chute_open_time = 1, chute_Ma = -1, chute_Mw = 5, chute_Kmx = 1, wind_sigma = 0, }, light = { start_time = 2, duration = 70, light_position = {0.225, 0, 0}, light_color = {0.55, 0.55, 0.55 * 0.8}, light_attenuation = 675, -- * 3 ! smoke_position = {0.225, 0, 0}, smoke_color = {0.952, 0.952, 0.952}, smoke_transparency = 200 / 255, smoke_width = 1, }, anim_constraints = { main_chute_min_arg_val = 0.8, lead_chute_min_arg_val = -1 }, anim_constraints_check_delay = { delay_par = 1 }, lead_chute_draw_arg_anim = { K_t = 2 }, shape_table_data = {{ file = "s-8_om_parashut", username = "ZUNI_MK33_FLARE_XENO", index = WSTYPE_PLACEHOLDER, }}, targeting_data = { char_time = 20.5 } } declare_weapon(ZUNI_MK33_FLARE_XENO) ZUNI_MK33_XENO = { --traditional rocket setup category = CAT_ROCKETS, name = "ZUNI_MK33_XENO", user_name = _(LocStr.MK33_name), display_name = LocStr.MK33_name, display_name_short = LocStr.MK33_name_sh, scheme = "nurs-light", class_name = "wAmmunitionNURS", model = "zuni", mass = Mk71Mod0.total_mass + 20.8, wsTypeOfWeapon = {4, 7, 33, WSTYPE_PLACEHOLDER}, cx_pil = 0.00016444708447773, shape_table_data = { { name = "ZUNI_MK33_XENO", file = "zuni", life = 1, fire = {0, 1}, username = LocStr.MK33_name, index = WSTYPE_PLACEHOLDER, }, }, control = { delay = 15.1 }, Launcher = { ammunition = ZUNI_MK33_FLARE_XENO, ammunition_name = "ZUNI_MK33_FLARE_XENO", delay = 15.1, }, dist_max = 5000, dist_max_ballistic = 8000, dist_min = 1000, max_TOF = 15.5, -- exaggerated a bit to avoid AI overshooting the target due to non-instant deceleration of the flare element properties = { dist_min = 1000, -- min range, meters dist_max = 5000, -- max range, meters dist_max_ballistic = 8000, max_TOF = 15.5, -- exaggerated a bit to avoid AI overshooting the target due to non-instant deceleration of the flare element }, fm = ZuniFM, engine = Mk71Mod0, } declare_weapon(ZUNI_MK33_XENO) declare_loadout({ category = CAT_ROCKETS, CLSID = "{LAU10_MK33_XENO}", wsTypeOfWeapon = ZUNI_MK33_XENO.wsTypeOfWeapon, attribute = {4, 7, 32, WSTYPE_PLACEHOLDER}, Count = 4, Cx_pil = LAU10_cx, Picture = "LAU10.png", displayName = "LAU-10 pod - 4 x " .. ", 127" .. LocStr.mm .. " ZUNI, " .. LocStr.UnGdRkts .. " MK 71, ".. LocStr.ILUM, Weight = LAU10_mass_empty + 4 * ZUNI_MK33_XENO.mass, Elements = { { ShapeName = "LAU-10" , IsAdapter = true}, --rockets itself { ShapeName = "zuni", Position = {0.1, 0.049, 0.072} }, { ShapeName = "zuni", Position = {0.1, 0.049, -0.073} }, { ShapeName = "zuni", Position = {0.1, -0.095, 0.072} }, { ShapeName = "zuni", Position = {0.1, -0.095, -0.073} }, }, JettisonSubmunitionOnly = false, }) I've tried adding explicit entries for both Client and Server, but that hasn't had any effect either. Though it does have the advantage of not causing crashes when trying to fire: it just doesn't fire at all. ZUNI_MK33_XENO = { --traditional rocket setup category = CAT_ROCKETS, name = "ZUNI_MK33_XENO", user_name = _(LocStr.MK33_name), display_name = LocStr.MK33_name, display_name_short = LocStr.MK33_name_sh, class_name = "wAmmunitionNURS", model = "zuni", mass = Mk71Mod0.total_mass + 20.8, wsTypeOfWeapon = {4, 7, 33, WSTYPE_PLACEHOLDER}, cx_pil = 0.00016444708447773, client = { category = 3, class_name = "wAmmunitionNURS", control = { delay = 15 }, displayName = LocStr.MK33_name, display_name_short = LocStr.MK33_name_sh, engine = Mk71Mod0, fm = ZuniFM, launcher = { ammunition = ZUNI_MK33_FLARE_XENO, ammunition_name = ZUNI_MK33_FLARE_XENO, server = 0, }, model = "zuni", name = "ZUNI_MK33_XENO", properties = { dist_max = 5000, dist_min = 2000, max_TOF = 15.1 }, scheme = "nurs-light", shape_table_data = { { name = "ZUNI_MK33_XENO", file = "zuni", life = 1, fire = {0, 1}, username = LocStr.MK33_name, index = WSTYPE_PLACEHOLDER, } }, user_name = _(LocStr.MK33_name), wsTypeOfWeapon = { 4, 7, 33, WSTYPE_PLACEHOLDER } }, server = { category = 3, class_name = "wAmmunitionNURS", control = { delay = 15 }, displayName = LocStr.MK33_name, display_name_short = LocStr.MK33_name_sh, engine = Mk71Mod0, fm = ZuniFM, launcher = { ammunition = ZUNI_MK33_FLARE_XENO, ammunition_name = ZUNI_MK33_FLARE_XENO, server = 1, }, model = "zuni", name = "ZUNI_MK33_XENO", properties = { dist_max = 5000, dist_min = 2000, max_TOF = 15.1 }, scheme = "nurs-light", shape_table_data = { { name = "ZUNI_MK33_XENO", file = "zuni", life = 1, fire = {0, 1}, username = LocStr.MK33_name, index = WSTYPE_PLACEHOLDER, } }, user_name = _(LocStr.MK33_name), wsTypeOfWeapon = { 4, 7, 33, WSTYPE_PLACEHOLDER } }, shape_table_data = { { name = "ZUNI_MK33_XENO", file = "zuni", life = 1, fire = {0, 1}, username = LocStr.MK33_name, index = WSTYPE_PLACEHOLDER, }, }, control = { delay = 15.1 }, Launcher = { ammunition = ZUNI_MK33_FLARE_XENO, ammunition_name = ZUNI_MK33_FLARE_XENO, delay = 15.1, server = { category = 3, class_name = "wAmmunitionNURS", control = { delay = 15 }, displayName = LocStr.MK33_name, display_name_short = LocStr.MK33_name_sh, engine = Mk71Mod0, fm = ZuniFM, launcher = { ammunition = ZUNI_MK33_FLARE_XENO, ammunition_name = ZUNI_MK33_FLARE_XENO, server = 1, }, model = "zuni", name = "ZUNI_MK33_XENO", properties = { dist_max = 5000, dist_min = 2000, max_TOF = 15.1 }, scheme = "nurs-light", shape_table_data = { { name = "ZUNI_MK33_XENO", file = "zuni", life = 1, fire = {0, 1}, username = LocStr.MK33_name, index = WSTYPE_PLACEHOLDER, } }, user_name = _(LocStr.MK33_name), wsTypeOfWeapon = { 4, 7, 33, WSTYPE_PLACEHOLDER } }, }, dist_max = 5000, dist_max_ballistic = 8000, dist_min = 1000, max_TOF = 15.5, -- exaggerated a bit to avoid AI overshooting the target due to non-instant deceleration of the flare element properties = { dist_min = 1000, -- min range, meters dist_max = 5000, -- max range, meters dist_max_ballistic = 8000, max_TOF = 15.5, -- exaggerated a bit to avoid AI overshooting the target due to non-instant deceleration of the flare element }, fm = ZuniFM, engine = Mk71Mod0, } declare_weapon(ZUNI_MK33_XENO) Has anyone else been successful at creating their own illumination flares or rockets? It'd be nice to look at something that works to compare and see where I've gone wrong. 1
Recommended Posts