Aginor Posted November 14, 2014 Posted November 14, 2014 (edited) Hey guys! I'm contemplating a mod I may or may not start to work on, but there are a few questions I have to answer first. Those I already know the answer to (or at least think I do) are included so you can take part in my thought process. 0. Is it possible to include new vehicles? - yes, it is. 1. Is it possible to animate them? - yes, it is. 2. Is it possible to arm them with existing weapons? - yes it is. 3. Is it possible to include new SAM missiles into DCSW? Perhaps by copying an existing one and tweaking its FM, like range or soemthing, then just swapping its model with a new one? 4. Is it possible to include new SAM radars to ground units? Perhaps also by copying an existing one and tweaking its parameters? 5. How do I tell a missile launcher that it should work with a certain radar? Has anything like that done before by modders, so I could get an example and work from there? EDIT: I know Beczl had something in the works long ago, but I think that was FC2-times, and has never worked in DCSW. Edited November 14, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 16, 2014 Author Posted November 16, 2014 So, I guess nobody has tried it yet? Then I will do some research. Any info on this topic would still be very appreciated. :) DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 19, 2014 Author Posted November 19, 2014 (edited) Hi again! You know, originally I wanted to create an SA-2 Mod, but it is a multi-unit thing, including radar properties and adding a new weapon, which may be too complex for my first try. So I turned it down a notch and will try to do something more simple. The SA-2 is still the goal (if it is possible, it may prove impossible), so if anybody can create a 3D model of an Sa-2, its launcher, and its radar, please let me know. So now the first goal is much simpler now: Create a Qassam rocket launcher. It will fire a single Grad rocket (I will try to add new weapons to the game later) every few minutes. The launcher will look like the ones in the picture in the upper right(even I can create that model, and I am a poor 3D modeler): http://en.wikipedia.org/wiki/Qassam_rocket The only problem for me is that I currently don't have a 3DsMax license. Can anyone here either create a model for that launcher in EDM or show me a way to convert a Blender file to EDM? ******************************************** I will now turn this thread into some kind of tutorial for myself and others, in order to learn to mod ground units. I'll have a lot of questions, so please, you experienced DCSW modders out there, correct me if I am wrong and give me a hint or two. :) I'm using numbers so you can refer to my steps more easily if you have comments or corrections. Starting with the (hopefully) completely simple stuff for adding units: 0. I start my mod by creating a directory in Mods/tech 1. in that directory (I'll call it Qassam from now on) I create two subdirectories: Textures and Shapes 2. The Shapes directory will be the place for the EDM files containing the model 3. The Textures directory will contain either textures or zip files containing textures. 4. There will be one or more lua files in the Qassam directory, which are going to be executed by the game (on launch?). Each of those tells the game about one unit and its properties, such as: - where the EDM files for the unit and also additional ones for the destroyed model and the LODs are. - where the textures are - the type of the unit, like a ship or a static object - which weapons are used by the unit - properties like whether a heli can land on them - what commands the unit knows (?) - what other units the unit depends on, such as radars for SAMs - others 5. I can also create a Theme directory here, including a picture for the module, a wallpaper and stuff like that. Also a lua file that tells the game whether the module is installed, which version etc. 6. I take a lua file from the Bazar directory (a stock unit that is similar and that is already in the game, in this case the Grad launcher) and change it around a bit. 7. ??? ok, that's about where my knowledge ends. As soon as I am at my DCS PC again I'll just post the lua file from the Grad launcher, then we can talk about it, and change it to achieve the following goals: a. change the name b. change the model c. change the textures d. change the rate of fire to one each two minutes e. change the number of missiles fired from a volley to one missile f. change the model when there is no missile. (I think that works by using an animation. Don't know how though. Yet.) We need an empty launcher when the rocket is fired, and a launcher with the rocket on it when it is ready to fire. Let's see if we can do this, I'm sure all the novice modders out there would be happy. :) Edited November 19, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
ED Team NineLine Posted November 19, 2014 ED Team Posted November 19, 2014 I have added my own shells and launcher into the sim while I ws playing with a flak gun. I am sure with the proper coding knowledge most of this stuff can be done. Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug**
will- Posted November 19, 2014 Posted November 19, 2014 Have you looked at the sam simulator in other sims thread? Intel i9-9900K 32GB DDR4, RTX 2080tiftw3, Windows 10, 1tb 970 M2, TM Warthog, 4k 144hz HDR g-sync.
Aginor Posted November 19, 2014 Author Posted November 19, 2014 Not yet. I went back one step, away from SAMs to more general stuff. I want to understand DCSW modding from the ground up. Coding isn't a problem, but what I don't understand yet is the particular structure of DCSW and where all the interfaces are. Those are pretty different to most games I modded until now. Some stuff is in the lua, some stuff may be in the engine itself. To make my mods a reality I have to understand what belongs in which of those categories. :) DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 19, 2014 Author Posted November 19, 2014 Ok, let's take a look at the LUA file: This is the one for the Grad: GT = {}; GT_t.ws = 0; set_recursive_metatable(GT, GT_t.generic_wheel_vehicle); set_recursive_metatable(GT.chassis, GT_t.CH_t.URAL375); GT.chassis.life = 1; GT.visual.shape = "bm-21-40"; GT.visual.shape_dstr = "BM-21-40_P_1"; --chassis GT.swing_on_run = false; GT.sensor = {}; set_recursive_metatable(GT.sensor, GT_t.SN_visual); GT.sensor.height = 2.85; --Burning after hit GT.visual.fire_size = 0.7; --relative burning size GT.visual.fire_pos[1] = 1; -- center of burn at long axis shift(meters) GT.visual.fire_pos[2] = 0;-- center of burn shift at vertical shift(meters) GT.visual.fire_pos[3] = 0; -- center of burn at transverse axis shift(meters) GT.visual.fire_time = 900; --burning time (seconds) GT.animation_arguments.crew_presence = 50; GT.WS = {}; GT.WS.fire_on_march = false; GT.WS.maxTargetDetectionRange = 21000; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].center = 'CENTER_TOWER'; GT.WS[ws].angles_mech = { {math.rad(102), math.rad(-70), math.rad(0), math.rad(55)}, }; GT.WS[ws].angles = { {math.rad(102), math.rad(45), math.rad(0), math.rad(55)}, {math.rad(45), math.rad(-45), math.rad(15), math.rad(55)}, {math.rad(-45), math.rad(-70), math.rad(0), math.rad(55)}, }; GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(7); GT.WS[ws].omegaZ = math.rad(5); GT.WS[ws].pidY = {p = 10, i = 0.0, d = 7, inn = 1}; GT.WS[ws].pidZ = {p = 10, i = 0.0, d = 7, inn = 1}; GT.WS[ws].mount_before_move = true; GT.WS[ws].LN = {}; GT.WS[ws].LN[1] = {}; GT.WS[ws].LN[1].type = 34; GT.WS[ws].LN[1].maxShootingSpeed = 0; GT.WS[ws].LN[1].out_velocity = 450; GT.WS[ws].LN[1].distanceMin = 5000; GT.WS[ws].LN[1].distanceMax = 19000; GT.WS[ws].LN[1].reactionTimeLOFAC = 3; GT.WS[ws].LN[1].reactionTime = 100; GT.WS[ws].LN[1].launch_delay = 0.5; GT.WS[ws].LN[1].barrels_reload_type = 2; GT.WS[ws].LN[1].sound = { single_shot = "Weapons/GradFiring", }; GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[0]); GT.WS[ws].LN[1].PL = {}; GT.WS[ws].LN[1].PL[1] = {}; GT.WS[ws].LN[1].PL[1].rocket_name = "weapons.nurs.GRAD_9M22U"; GT.WS[ws].LN[1].PL[1].ammo_capacity = 40; GT.WS[ws].LN[1].PL[1].reload_time = 1; GT.WS[ws].LN[1].PL[1].shot_delay = 420; GT.WS[ws].LN[1].BR = { }; GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_ROCKET_01"}; GT.WS[ws].LN[1].BR[2] = { connector_name = "POINT_ROCKET_06"}; GT.WS[ws].LN[1].BR[3] = { connector_name = "POINT_ROCKET_10"}; GT.WS[ws].LN[1].BR[4] = { connector_name = "POINT_ROCKET_05"}; GT.WS[ws].LN[1].BR[5] = { connector_name = "POINT_ROCKET_11"}; GT.WS[ws].LN[1].BR[6] = { connector_name = "POINT_ROCKET_16"}; GT.WS[ws].LN[1].BR[7] = { connector_name = "POINT_ROCKET_20"}; GT.WS[ws].LN[1].BR[8] = { connector_name = "POINT_ROCKET_15"}; GT.WS[ws].LN[1].BR[9] = { connector_name = "POINT_ROCKET_02"}; GT.WS[ws].LN[1].BR[10] ={ connector_name = "POINT_ROCKET_07"}; GT.WS[ws].LN[1].BR[11] ={ connector_name = "POINT_ROCKET_09"}; GT.WS[ws].LN[1].BR[12] ={ connector_name = "POINT_ROCKET_04"}; GT.WS[ws].LN[1].BR[13] ={ connector_name = "POINT_ROCKET_12"}; GT.WS[ws].LN[1].BR[14] ={ connector_name = "POINT_ROCKET_17"}; GT.WS[ws].LN[1].BR[15] ={ connector_name = "POINT_ROCKET_19"}; GT.WS[ws].LN[1].BR[16] ={ connector_name = "POINT_ROCKET_14"}; GT.WS[ws].LN[1].BR[17] ={ connector_name = "POINT_ROCKET_03"}; GT.WS[ws].LN[1].BR[18] ={ connector_name = "POINT_ROCKET_08"}; GT.WS[ws].LN[1].BR[19] ={ connector_name = "POINT_ROCKET_13"}; GT.WS[ws].LN[1].BR[20] ={ connector_name = "POINT_ROCKET_18"}; GT.WS[ws].LN[1].BR[21] ={ connector_name = "POINT_ROCKET_21"}; GT.WS[ws].LN[1].BR[22] ={ connector_name = "POINT_ROCKET_26"}; GT.WS[ws].LN[1].BR[23] ={ connector_name = "POINT_ROCKET_30"}; GT.WS[ws].LN[1].BR[24] ={ connector_name = "POINT_ROCKET_25"}; GT.WS[ws].LN[1].BR[25] ={ connector_name = "POINT_ROCKET_31"}; GT.WS[ws].LN[1].BR[26] ={ connector_name = "POINT_ROCKET_36"}; GT.WS[ws].LN[1].BR[27] ={ connector_name = "POINT_ROCKET_40"}; GT.WS[ws].LN[1].BR[28] ={ connector_name = "POINT_ROCKET_35"}; GT.WS[ws].LN[1].BR[29] ={ connector_name = "POINT_ROCKET_22"}; GT.WS[ws].LN[1].BR[30] ={ connector_name = "POINT_ROCKET_27"}; GT.WS[ws].LN[1].BR[31] ={ connector_name = "POINT_ROCKET_29"}; GT.WS[ws].LN[1].BR[32] ={ connector_name = "POINT_ROCKET_24"}; GT.WS[ws].LN[1].BR[33] ={ connector_name = "POINT_ROCKET_32"}; GT.WS[ws].LN[1].BR[34] ={ connector_name = "POINT_ROCKET_37"}; GT.WS[ws].LN[1].BR[35] ={ connector_name = "POINT_ROCKET_39"}; GT.WS[ws].LN[1].BR[36] ={ connector_name = "POINT_ROCKET_34"}; GT.WS[ws].LN[1].BR[37] ={ connector_name = "POINT_ROCKET_23"}; GT.WS[ws].LN[1].BR[38] ={ connector_name = "POINT_ROCKET_28"}; GT.WS[ws].LN[1].BR[39] ={ connector_name = "POINT_ROCKET_33"}; GT.WS[ws].LN[1].BR[40] ={ connector_name = "POINT_ROCKET_38"}; GT.WS[ws].LN[1].customViewPoint = { "genericMLRS", {-3.0, 0.3, -0.8 }, }; GT.Name = "Grad-URAL"; GT.Aliases = {"MLRS BM-21 Grad"} GT.DisplayName = _("MLRS BM-21 Grad"); GT.Rate = 10; GT.DetectionRange = 0; GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin; GT.ThreatRange = 19000; GT.mapclasskey = "P0091000208"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericMLRS, "MLRS", }; GT.category = "Artillery"; As you can see you can divide it into the following parts: 1. loading model, textures, and some effects (like the fire burning when the vehicle is hit) 2. Adding a weapon system (WS), including the angles at which it can fire, the firing parameters (reaction, reload, launch delay, sound and so on) 3. Name, category, and some attributes in the Mission Editor. A closer look at the first category tells me that the unit seems to inherit some stuff from metatables, for example the attributes for the URAL375 truck. I guess we won't need those for our static launcher later. So I cross-checked that against the mortar, and there it looks like this: set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; The rest looks pretty clear to me at the moment, so let's move on to the second big block, the weapons: I get the part with the CENTER TOWER and the angles, if you look into the EDM file you can see it. It is where it can move to and fire. Not sure what the "drawArgument", "omega", and "pid" statements mean, any ideas? Then there's the paramters for the sensor and launch parameters. I guess LN means launch? Those seem to be objects. The PL child object seems to define the type of ammo used, and some parameters for it. Then there is the BR part. The connectors are visible in the EDM file as well, those are the barrels. I expect our Qassam launcher to have only one of them later, but the Grad has 40 of them. Does anyone know what BR means? The last block is pretty clear to me, except the mapclasskey. Any ideas? I'll go ahead and change all the parts I _think_ should be suitable for the Qassam, and post that. I'll take some stuff from the mortar and some from the Grad launcher. Here's the mortar file, we may need it later: -- 2B11 120mm GT = {}; GT_t.ws = 0; set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; GT.visual.shape = "2B11" GT.visual.shape_dstr = "2B11_P_1" --chassis GT.sensor = {} set_recursive_metatable(GT.sensor, GT_t.SN_visual) GT.sensor.height = 2.3 --Burning after hit GT.visual.fire_time = 3 --burning time (seconds) -- weapon systems --GT.WS[1] GT.WS = {}; GT.WS.maxTargetDetectionRange = 10000; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].newZ = false; GT.WS[ws].new_rotation = false; GT.WS[ws].center = 'CENTER_TOWER'; GT.WS[ws].angles = { {math.rad(180), math.rad(-180),math.rad(45), math.rad(80),}, }; GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(30); GT.WS[ws].omegaZ = math.rad(30); GT.WS[ws].pidY = {p=10, i=0.02, d=8}; GT.WS[ws].pidZ = {p=10, i=0.02, d=8}; GT.WS[ws].reference_angle_Z = math.rad(60); --GT.WS[1].LN[1] __LN = add_launcher(GT.WS[ws], GT_t.LN_t.howitzer_2A60); __LN.connectorFire = false; __LN.BR[1].connector_name = 'POINT_GUN'; __LN.reactionTimeLOFAC = 3; __LN.reactionTime = 100; __LN = nil; GT.Name = "2B11 mortar"; GT.DisplayName = _("2B11 mortar"); GT.Rate = 5; GT.DetectionRange = 0; GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin; GT.ThreatRange = 7000; GT.mapclasskey = "P0091000006"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Gun,wsType_GenericSAU, "Artillery", }; GT.category = "Artillery"; And something I almost forgot: I looked into some mods and they all have a few lines in the beginning of the lua file that tell the sim not to use the standard paths but to include other directories. They look like this: mount_vfs_model_path (current_mod_path.."/Shapes") mount_vfs_liveries_path (current_mod_path.."/Liveries") mount_vfs_texture_path (current_mod_path.."/Textures/Textures.zip") DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 19, 2014 Author Posted November 19, 2014 And here's my Qassam file. I commented a few lines. Any remarks? -- Qassam rocket launcher mount_vfs_model_path (current_mod_path.."/Shapes") mount_vfs_liveries_path (current_mod_path.."/Liveries") mount_vfs_texture_path (current_mod_path.."/Textures/Textures.zip") GT = {}; GT_t.ws = 0; set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; -- not much life GT.visual.shape = "Qassam" -- functional model GT.visual.shape_dstr = "Qassam_P_1" -- destroyed model --chassis GT.swing_on_run = false; -- don't know what this does, I think we could omit it GT.sensor = {}; set_recursive_metatable(GT.sensor, GT_t.SN_visual); GT.sensor.height = 2.00; -- doesn't matter much I guess --Burning after hit, will be adjusted when the model is there GT.visual.fire_size = 0.7; --relative burning size GT.visual.fire_pos[1] = 1; -- center of burn at long axis shift(meters) GT.visual.fire_pos[2] = 0;-- center of burn shift at vertical shift(meters) GT.visual.fire_pos[3] = 0; -- center of burn at transverse axis shift(meters) GT.visual.fire_time = 90; --burning time (seconds) GT.animation_arguments.crew_presence = 50; GT.WS = {}; GT.WS.fire_on_march = false; -- doesn't move anyway GT.WS.maxTargetDetectionRange = 21000; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].center = 'CENTER_TOWER'; -- angles from the mortar, needs tweaking GT.WS[ws].angles = { {math.rad(180), math.rad(-180),math.rad(45), math.rad(80),}, }; --not sure what those do GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(30); GT.WS[ws].omegaZ = math.rad(30); GT.WS[ws].pidY = {p=10, i=0.02, d=8}; GT.WS[ws].pidZ = {p=10, i=0.02, d=8}; GT.WS[ws].reference_angle_Z = math.rad(60); GT.WS[ws].LN = {}; GT.WS[ws].LN[1] = {}; GT.WS[ws].LN[1].type = 34; GT.WS[ws].LN[1].maxShootingSpeed = 0; GT.WS[ws].LN[1].out_velocity = 450; GT.WS[ws].LN[1].distanceMin = 5000; GT.WS[ws].LN[1].distanceMax = 19000; GT.WS[ws].LN[1].reactionTimeLOFAC = 3; GT.WS[ws].LN[1].reactionTime = 100; GT.WS[ws].LN[1].launch_delay = 0.5; GT.WS[ws].LN[1].barrels_reload_type = 2; GT.WS[ws].LN[1].sound = { single_shot = "Weapons/GradFiring", }; GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[0]); GT.WS[ws].LN[1].PL = {}; GT.WS[ws].LN[1].PL[1] = {}; GT.WS[ws].LN[1].PL[1].rocket_name = "weapons.nurs.GRAD_9M22U"; GT.WS[ws].LN[1].PL[1].ammo_capacity = 40; GT.WS[ws].LN[1].PL[1].reload_time = 1; GT.WS[ws].LN[1].PL[1].shot_delay = 420; GT.WS[ws].LN[1].BR = { }; GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_ROCKET_01"}; -- we will need that point later in our EDM GT.WS[ws].LN[1].customViewPoint = { "genericMLRS", {-3.0, 0.3, -0.8 }, }; GT.Name = "Qassam"; GT.Aliases = {"Qassam launcher"} GT.DisplayName = _("Qassam launcher"); GT.Rate = 10; GT.DetectionRange = 0; GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin; GT.ThreatRange = 19000; GT.mapclasskey = "P0091000208"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericMLRS, "MLRS", }; GT.category = "Artillery"; DCSW weapons cheat sheet speed cheat sheet
vicx Posted November 19, 2014 Posted November 19, 2014 I was watching this thread to see what sort of stuff you were interested in doing. I am interested in adding interfaces and cockpits to existing vehicles, probably SAMs and/or command vehicles (just to learn how). Now for some reason I thought a Qassam was modified SCUD but it's just a ghetto redneck WW1 rocket. I actually think using the MLRS as a base is VERY generous but at least there may be a way to dumb it down. "DCS World/Scripts/Database/scripts/sensors.lua" Add or modify a new entry. For testing I'd steal the 2nd gen tanks entry. -- tanks 2-nd generation, Leo1, M60, (useless things anyway) WSN_6 = {} WSN_6.deviation_error_azimuth = 0.0007 WSN_6.deviation_error_elevation = 0.0007 WSN_6.deviation_error_speed_sensor = 0.12 WSN_6.deviation_error_stability = 0.001 WSN_6.deviation_error_distance = 0.023 A ghetto rocket is going to have much larger errors in all those values. So edit and test and edit and test. In your Qassam entry GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[0]); Change to GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[6]); I have wanted to play with these values but it would be a distraction for me. Share what you learn :)
Aginor Posted November 19, 2014 Author Posted November 19, 2014 Great, thank you! That sensor stuff you posted is exactly what I was looking for, and I fully agree that a very very low accuracy is in order. The people who use those rockets are normally pretty happy if they hit the right district, and they are probably still content with hitting the city they are aiming for. I chose the Qassam because it is simple, and it is on my DCS wish list. So I guess we are one step closer. Now the model is the next step I guess. Are there any tutorials on how to convert assets created in Blender to EDM? I'm halfway proficient with older versions of 3DsMax, but as I said before, I don't have a license, so I'm stuck with Blender for now. DCSW weapons cheat sheet speed cheat sheet
vicx Posted November 19, 2014 Posted November 19, 2014 (edited) I know this answer from the forums not from personal experience. In all threads it is stated you must use MAX and the DCS tools from inside MAX. There is no other way and there are no plans for other ways. Solution: For now use the mortar model and re-texture. I still think using the MLRS as a base is the weak point though. The launch velocity of one of these Qassam is going to be slow and the trajectory should be low. The MLRS is high velocity and very high. They do not really share similar qualities. A TOW missile without a wire is a closer in quality to what you need in almost every respect. Low velocity, low accuracy and destructive capability quite limited. You would just have to disable the self-destruct that happens to TOWS when they pass beyond their range limit. This might make them pass beyond their range limits and fall in an arc. A quick skim of DCS World\Config\Weapons\missiles_data.lua provides a good candidate list. The TOWS have a low mach speed. Normally they detonate after Life_Time expires but if you make that much longer who knows what will happen. Edited November 20, 2014 by vicx info on Life_Time
Aginor Posted November 20, 2014 Author Posted November 20, 2014 Since I don't have any clue yet how weapons really work in DCSW I will keep the Grad rocket for the first try. I will also follow your suggestion and use the mortar model in version 1. I hope I will get the opportunity to do that tonight. DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 20, 2014 Author Posted November 20, 2014 Ok, I copied the mortar models, changed the object POINT_ROCKET1 to POINT_GUN because that's the way it is called in the EDM, and I added the line add_surface_unit(GT) to the lua. Then I copied the whole Qassam directory into Mods/tech. I can't see the thing in the ME though, what am I doing wrong? DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 20, 2014 Author Posted November 20, 2014 (edited) Figured it out. I used slashes for one comment in the file, instead of dashes. Must be the bad influence pf all the Java, PHP and C.... :D Now my mortar/grad hybrid is ingame. Doesn't fire though, I will check the logs. EDIT: Nothing suspicious in the logs (at least I can't see anything). Here's the file, any ideas? -- Qassam rocket launcher mount_vfs_model_path (current_mod_path.."/Shapes") mount_vfs_liveries_path (current_mod_path.."/Liveries") mount_vfs_texture_path (current_mod_path.."/Textures/Textures.zip") GT = {}; GT_t.ws = 0; set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; -- not much life GT.visual.shape = "Qassam_laun" -- functional model GT.visual.shape_dstr = "Qassam_laun_p_1" -- destroyed model --chassis -- GT.swing_on_run = false; -- don't know what this does, I think we could omit it GT.sensor = {}; set_recursive_metatable(GT.sensor, GT_t.SN_visual); GT.sensor.height = 2.00; -- doesn't matter much I guess --Burning after hit, will be adjusted when the model is there GT.visual.fire_size = 0.7; --relative burning size GT.visual.fire_pos[1] = 1; -- center of burn at long axis shift(meters) GT.visual.fire_pos[2] = 0;-- center of burn shift at vertical shift(meters) GT.visual.fire_pos[3] = 0; -- center of burn at transverse axis shift(meters) GT.visual.fire_time = 90; --burning time (seconds) GT.animation_arguments.crew_presence = 50; GT.WS = {}; -- GT.WS.fire_on_march = false; -- doesn't move anyway GT.WS.maxTargetDetectionRange = 20000; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].newZ = false; GT.WS[ws].new_rotation = false; GT.WS[ws].center = 'CENTER_TOWER'; -- angles from the mortar, needs tweaking GT.WS[ws].angles = { {math.rad(180), math.rad(-180),math.rad(45), math.rad(80),}, }; --not sure what those do GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(30); GT.WS[ws].omegaZ = math.rad(30); GT.WS[ws].pidY = {p=10, i=0.02, d=8}; GT.WS[ws].pidZ = {p=10, i=0.02, d=8}; GT.WS[ws].reference_angle_Z = math.rad(60); GT.WS[ws].LN = {}; GT.WS[ws].LN[1] = {}; GT.WS[ws].LN[1].type = 34; GT.WS[ws].LN[1].maxShootingSpeed = 0; GT.WS[ws].LN[1].out_velocity = 450; GT.WS[ws].LN[1].distanceMin = 5000; GT.WS[ws].LN[1].distanceMax = 19000; GT.WS[ws].LN[1].reactionTimeLOFAC = 3; GT.WS[ws].LN[1].reactionTime = 100; GT.WS[ws].LN[1].launch_delay = 0.5; GT.WS[ws].LN[1].barrels_reload_type = 2; GT.WS[ws].LN[1].sound = { single_shot = "Weapons/GradFiring", }; -- for now sensor of old tanks, see sensors.lua GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[6]); GT.WS[ws].LN[1].PL = {}; GT.WS[ws].LN[1].PL[1] = {}; GT.WS[ws].LN[1].PL[1].rocket_name = "weapons.nurs.GRAD_9M22U"; GT.WS[ws].LN[1].PL[1].ammo_capacity = 40; GT.WS[ws].LN[1].PL[1].reload_time = 1; GT.WS[ws].LN[1].PL[1].shot_delay = 420; GT.WS[ws].LN[1].BR = { }; GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_GUN"}; -- we will need that point later in our EDM GT.WS[ws].LN[1].customViewPoint = { "genericMLRS", {-3.0, 0.3, -0.8 }, }; GT.Name = "Qassam"; GT.Aliases = {"Qassam launcher"} GT.DisplayName = _("Qassam launcher"); GT.Rate = 10; GT.DetectionRange = 0; GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin; GT.ThreatRange = 19000; GT.mapclasskey = "P0091000208"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericMLRS, "MLRS", }; GT.category = "Artillery"; add_surface_unit(GT) EDIT: I also noticed in some other files there are blocks with double underscores it seems, what do they mean? Example: --GT.WS[1].LN[1] __LN = add_launcher(GT.WS[ws], GT_t.LN_t.howitzer_2A60); __LN.connectorFire = false; __LN.BR[1].connector_name = 'POINT_GUN'; __LN.reactionTimeLOFAC = 3; __LN.reactionTime = 100; __LN = nil; Edited November 20, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
vicx Posted November 21, 2014 Posted November 21, 2014 Can't help right now but when I have time I will work with what you have put together and see what can be done. Last night I spent a minute modding and testing a TOW by extending it's Life_time. It flew off into the sky never to return so perhaps that modelling is too simple for a ballistic path. After that I tried a missile with AFM. I made entry changes to the Tunguska rocket stage table by adjusting thrust and burn-time. The rocket falls from the sky after the burn energy is used up. Some setting that defines the fins and COG plays a large part in flight path after that.
Flagrum Posted November 21, 2014 Posted November 21, 2014 My Lua-fu is not too strong, but regarding the underscores ... I think, these are some sort of naming conventions. I think, I have seen them used to denote tables that are global ... or local variables which are references to global tables. Something like that ...
Flagrum Posted November 21, 2014 Posted November 21, 2014 Btw, Ranger79 has made some new, cool ground units that are implemented in ...\mods\tech - maybe he or his scripts can help you? Example: http://forums.eagle.ru/showthread.php?t=121976
Aginor Posted November 21, 2014 Author Posted November 21, 2014 (edited) @Flagrum: There are a few modders on these forums I'd like to ask for a little bit of help. upuaut, Lilkiki, Markindel, Ranger79, SilverDragon and uboats are the ones from the top of my head. Almost everything concerning ground unit mods has been done by one of those guys. I downloaded some of their mods already (like the USS Cole, the German WWII units, the ship and also Ranger's pack). I learned a lot by just looking at those. So this post is also a shout-out to those guys. You are great, thank you! @vicx: Interesting, sounds like a promising approach. I wonder if we can later do SAMs that actually launch steep and attack the target from above, like some SAMs in real life do. @mods: Could we rename the thread to "Ground unit development"? Edited November 21, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 21, 2014 Author Posted November 21, 2014 I didn't get it to work, with the mortar model it does turn, but it doesn't fire. So I just tried the following: I took the whole weapons and sensors block from the original grad lua into my qassam.lua The thing fired, as expected. I then tried to let it fire all rockets from one barrel (worked, by changing the connector names all to POINT_ROCKET_01) and to let it fire only one rocket (worked, by just deleting all the GT.WS[ws].LN[1].BR[XX] lines except one). But if I use the mortar model, with all the same stuff, except that I change the GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_ROCKET_01"}; to GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_GUN"}; (I do that because the mortar edm doesn't have a connector called POINT_ROCKET) But it doesn't work. Maybe it is the firing angle? The mortar model cannot move its vertical barrel position, the grad can. Is there a workaround for that restriction? DCSW weapons cheat sheet speed cheat sheet
vicx Posted November 22, 2014 Posted November 22, 2014 Post your lua. I've had some success with my experiments and also found some cool and unusual effects firing various missiles. Will post a video and some lua soon. I'm just seeing if I can put all the mods into one file.
vicx Posted November 22, 2014 Posted November 22, 2014 I am uploading a video of the 9M331 being aimed and fired from a mortar. The 9M331 has had it's flight model modified to have a LOT less thrust. This was to keep the missile around 600kph which is closer to what you are trying to model than the ~Mach3 speed it can do. I shortened the range because I am impatient when testing. === I will post the lua soon. I'm just seeing if I can combine all the into one file (I really hope so). To answer your questions, It looks like you can angle the rocket any damn way you want but for it to look good you need to match it up to the animation limits in the edm. Depending on the rocket/missile you are cribbing from you may have to change it's entry to make it visible in order to see if before it fires.This will also make it easier to work with. If you use a connector you have to be careful that the rocket/missile has room to spawn. If parts of the rocket/missile spawn inside another model or the ground I think it makes the missile inert (it will not fire). Sometimes you can't use connectors but you can at least use a connector to help you find the right angles and offests to manually place the rotation center and the rocket/missile attach-point. I used a TOW missile type for reasons I have mentioned earlier in the thread. It turns out that the TOW missile type is the easiest of the missile types to work with. I'm not finished testing yet but I have fired a few missiles out of this mortar tube. I just shot a Harpoon into space. The video is taking ages to upload. Here is a harpoon in space.
vicx Posted November 22, 2014 Posted November 22, 2014 I am using Jibs DSHK.lua and Entry.lua as a base for this tech mod. Jib demonstrates the best technique AFAIK for correctly adding a ground unit. -- /Mods/tech/MortarRocket/MortarRocket.lua mount_vfs_model_path (current_mod_path.."/Shapes") mount_vfs_liveries_path (current_mod_path.."/Liveries") mount_vfs_texture_path (current_mod_path.."/Textures/Textures.zip") GT = {}; GT_t.ws = 0; --chassis set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; -- not much life GT.visual.shape = "2b11.edm" -- functional model GT.visual.shape_dstr = "2b11_p_1.edm" -- destroyed model GT.WS = {}; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].newZ = false; GT.WS[ws].new_rotation = false; GT.WS[ws].center = 'CENTER_TOWER'; GT.WS[ws].angles = { -- how to come to these figures I will make into a post of it's own {math.rad(180), math.rad(-180),math.rad(-18), math.rad(17),}, }; GT.WS[ws].reference_angle_Z = math.rad(63); GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(80); GT.WS[ws].omegaZ = math.rad(100); GT.WS[ws].pidY = {p=100,i=2.0,d=10, inn = 10}; GT.WS[ws].pidZ = {p=100,i=2.0,d=10, inn = 10}; __LN = add_launcher(GT.WS[ws], GT_t.LN_t._9M311); --TYPE 33 TOW -- change flight model of missile in config/ -- I put these other entries here for the fun of your testing. --__LN = add_launcher(GT.WS[ws], GT_t.LN_t.TOMAHAWK); --TYPE 8 (change to 33 in missile.lua) --__LN = add_launcher(GT.WS[ws], GT_t.LN_t.HARPOON); --TYPE 1 (change to 33 in missle.lua) --__LN = add_launcher(GT.WS[ws], GT_t.LN_t.C_24); --type rocket not yet tested __LN.connectorFire = false; -looks interesting __LN.BR = {{ connector_name = "POINT_GUN"} } --__LN.BR = {{pos = {0, 1, 0}}} __LN.customViewPoint = { "genericAAA", {-0.3, 0.3, 0.0 }, }; -- viewpoint needs work __LN.sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[6]); __LN = nil; -- The mods to missile.lua and missile_data.lua is all hacks. A better approach to encapsualte all modifications into a single lua file should be investigated GT.Name = "MortarRocket"; GT.Aliases = {"MortarRocket"} GT.DisplayName = _("MortarRocket"); GT.Rate = 1; GT.DetectionRange = 0; GT.ThreatRangeMin = 0; GT.ThreatRange = 19000; GT.mapclasskey = "P0091000208"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericSAU, "Artillery", }; GT.category = "Artillery"; add_surface_unit(GT) --/Mods/tech/MortarRocket/Entry.lua --Cribbed from Jib declare_plugin("DSHK by Jib", { installed = true, -- if false that will be place holder , or advertising dirName = current_mod_path, version = "1", state = "installed", info = _("Test of Adding New Ground Units to DCS"), binaries = { "GroundCockpitBase", "CombinedArms.dll", }, LogBook = { { name = _("DSHK"), type = "DSHK", }, }, InputProfiles = { ["DSHK"] = current_mod_path .. '/Input', }, Options = { { name = _("CA"), nameId = "CA", dir = "Options", CLSID = "{AE699235-F086-401f-93C8-B0FCB0E4A2ED}" }, }, }) --dofile(current_mod_path..'/DSHK.lua') dofile(current_mod_path..'/MortarRocket.lua') --make_flyable('DSHK') --make_flyable("DSHK",current_mod_path..'/Cockpit') plugin_done()-- finish declaration , clear temporal data 1
Aginor Posted November 22, 2014 Author Posted November 22, 2014 (edited) Holy Crap! This is awesome, man! +Rep incoming. So let's see. As far as I understood I don't need an entry.lua, if none exists the sim just searches for lua files in the mod directory and executes them all. Here's my lua: -- Qassam rocket launcher mount_vfs_model_path (current_mod_path.."/Shapes") mount_vfs_liveries_path (current_mod_path.."/Liveries") mount_vfs_texture_path (current_mod_path.."/Textures/Textures.zip") GT = {}; GT_t.ws = 0; set_recursive_metatable(GT, GT_t.generic_stationary); GT.armour_scheme = unarmed_armour_scheme; set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC); GT.chassis.life = 0.1; -- not much life GT.visual.shape = "Qassam_laun" -- functional model GT.visual.shape_dstr = "Qassam_laun_p_1" -- destroyed model --chassis GT.swing_on_run = false; GT.sensor = {}; set_recursive_metatable(GT.sensor, GT_t.SN_visual); GT.sensor.height = 2.85; --Burning after hit GT.visual.fire_size = 0.7; --relative burning size GT.visual.fire_pos[1] = 1; -- center of burn at long axis shift(meters) GT.visual.fire_pos[2] = 0;-- center of burn shift at vertical shift(meters) GT.visual.fire_pos[3] = 0; -- center of burn at transverse axis shift(meters) GT.visual.fire_time = 90; --burning time (seconds) GT.animation_arguments.crew_presence = 50; GT.WS = {}; GT.WS.fire_on_march = false; GT.WS.maxTargetDetectionRange = 21000; local ws = GT_t.inc_ws(); GT.WS[ws] = {}; GT.WS[ws].center = 'CENTER_TOWER'; GT.WS[ws].angles_mech = { {math.rad(102), math.rad(-70), math.rad(0), math.rad(55)}, }; GT.WS[ws].angles = { {math.rad(102), math.rad(45), math.rad(0), math.rad(55)}, {math.rad(45), math.rad(-45), math.rad(15), math.rad(55)}, {math.rad(-45), math.rad(-70), math.rad(0), math.rad(55)}, }; GT.WS[ws].drawArgument1 = 0; GT.WS[ws].drawArgument2 = 1; GT.WS[ws].omegaY = math.rad(7); GT.WS[ws].omegaZ = math.rad(5); GT.WS[ws].pidY = {p = 10, i = 0.0, d = 7, inn = 1}; GT.WS[ws].pidZ = {p = 10, i = 0.0, d = 7, inn = 1}; GT.WS[ws].mount_before_move = true; GT.WS[ws].LN = {}; GT.WS[ws].LN[1] = {}; GT.WS[ws].LN[1].type = 34; GT.WS[ws].LN[1].maxShootingSpeed = 0; GT.WS[ws].LN[1].out_velocity = 450; GT.WS[ws].LN[1].distanceMin = 5000; GT.WS[ws].LN[1].distanceMax = 19000; GT.WS[ws].LN[1].reactionTimeLOFAC = 3; GT.WS[ws].LN[1].reactionTime = 100; GT.WS[ws].LN[1].launch_delay = 0.5; GT.WS[ws].LN[1].barrels_reload_type = 2; GT.WS[ws].LN[1].sound = { single_shot = "Weapons/GradFiring", }; GT.WS[ws].LN[1].sensor = {}; set_recursive_metatable(GT.WS[ws].LN[1].sensor, GT_t.WSN_t[0]); GT.WS[ws].LN[1].PL = {}; GT.WS[ws].LN[1].PL[1] = {}; GT.WS[ws].LN[1].PL[1].rocket_name = "weapons.nurs.GRAD_9M22U"; GT.WS[ws].LN[1].PL[1].ammo_capacity = 40; GT.WS[ws].LN[1].PL[1].reload_time = 1; GT.WS[ws].LN[1].PL[1].shot_delay = 420; GT.WS[ws].LN[1].BR = { }; GT.WS[ws].LN[1].BR[1] = { connector_name = "POINT_GUN"}; GT.WS[ws].LN[1].customViewPoint = { "genericMLRS", {-3.0, 0.3, -0.8 }, }; GT.Name = "Qassam"; GT.Aliases = {"Qassam launcher"} GT.DisplayName = _("Qassam launcher"); GT.Rate = 10; GT.DetectionRange = 0; GT.ThreatRangeMin = GT.WS[1].LN[1].distanceMin; GT.ThreatRange = 19000; GT.mapclasskey = "P0091000208"; GT.attribute = {wsType_Ground,wsType_Tank,wsType_Miss,wsType_GenericMLRS, "MLRS", }; GT.category = "Artillery"; add_surface_unit(GT)I will immediately try the one you posted, though. That's pretty darn close to what I am trying to achieve. Edited November 22, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Aginor Posted November 22, 2014 Author Posted November 22, 2014 (edited) Ok, there is something horribly wrong. It doesn't fire, not even with your entry.lua and MortarRocket.lua There was one error in the MortarRocket.lua (just a typo), that caused the mod not loading, I fixed it. The model shows correctly in the ME and game, but there is no rocket and it doesn't fire. :( Could you maybe post the whole MortarRocket Mod directory like you had it for the video in a zip file, together with a mission in which it works? That way I could at least tell if there is something weird in my DCS installation that prevents it from working. Edited November 22, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Tek Posted November 22, 2014 Posted November 22, 2014 would it not be prudent to wait for DCS2.0? Don't get me wrong I am in awe of all people that are willing to invest time in Modding and I hope you continue. However, Last i heard DCS is moving away from .lua when 2.0 comes in which is "just around the corner". I am not that software/code savvy to be able to have a valid opinion but won't any mods be rendered useless if DCS does move away from .lua? maybe i was drunk when i read that somewhere or maybe i have no idea what i am talking about.... "In victory you deserve champagne, in defeat you need it" - Winston Churchill 3700X | X570 Aorus Elite | GTX 1070 | 32GB 3200 (3600)mhz Corsair | XFX 850W PSU | Lian Li Lan Cool 2 | Tir5 + TCP, VIVE Cosmos Elite | TMWH #08677 | Saitek Combat Pedals
Recommended Posts