Jump to content

Declaring new missile in tech mod


swither

Recommended Posts

Hi!

 

I'm working on a Visby Corvette (Wikipedia linik) mod and i've got it up and running (no textures yet) in DCS.

 

Screenshots:

 

 

Vmca1jC.png

ctwNIx3.png

3xbKqrK.png

 

 

 

 

Canon is working, but I'm having problems with adding the missiles (RBS 15 wikipedia) to the ship. I've declared the weapon like this:

 


local RBS_15 = 
{
       category        = CAT_MISSILES,
       name            = "RBS-15",
       user_name         = _("RBS-15"),
       Escort             = 3,     --tror detta styr  om den har boosters
       Head_Type         = 5,    --Autopilot
       sigma = {3, 3, 3},
       M = 800.0,
       H_max = 12000.0,
       H_min = -1,
       Diam = 500.0,
       Cx_pil = 1,
       D_max = 250000.0,
       D_min = 2000.0,
       Head_Form = 0,
       Life_Time = 7200.0,
       Nr_max = 17,
       v_min = 170.0,
       v_mid = 238.0,
       Mach_max = 0.85,
       t_b = 0.0,
       t_acc = 14.0,
       t_marsh = 7200.0,
       Range_max = 250000.0,
       H_min_t = 0.0,
       Fi_start = 3.14152,
       Fi_rak = 3.14152,
       Fi_excort = 3.14152,
       Fi_search = 99.9,
       OmViz_max = 99.9,
       Reflection = 0.3,
       KillDistance = 0.0,

       warhead         = 
       {
           mass                     = 800; 
           expl_mass                 = 200; 
           other_factors             = {1, 1, 1};
           obj_factors             = {1, 1};
           concrete_factors         = {1, 1, 1};
           cumulative_factor         = 3.0;
           concrete_obj_factor     = 0.0;
           cumulative_thickness     = 0.9;
           piercing_mass            = 50.0;
           caliber                    = 400,
       },

       Damage             = 50, 
       exhaust1 = tail_solid,
       exhaust2 = tail_solid,
       --exhaust         = {0.9, 0.9, 0.85, 0.3},  -- Tail smoke color format {R, G, B, alpha}. All values from 0 to 1
       X_back             = -1.872, -- exhaust X
       Y_back             = 0.0,  -- exhaust Y
       Z_back             = 0.0,  -- exhaust Z
       X_back_acc = -1.407,
       Y_back_acc = 0,
       Z_back_acc =  0.35,

       Reflection         = 0.015, -- radar reflection cross
       KillDistance     = 0.0, -- this distance is used to fire a fuze // type 428 proximity fuze
       shape_table_data = 
       {
           {
               name     = "RBS-15";
               file       = "rbs15";
               life       = 1;
               fire       = { 0, 1};
               username = "RBS-15";
               index = WSTYPE_PLACEHOLDER;
           },
       }
   },

declare_weapon(RBS_15)

and defined the weapon system like this

 

GT_t.WS_t.ship_RBS_15 = {} 
--GT_t.WS_t.ship_RBS_15.angles = {
--                    {math.rad(45), math.rad(-45), math.rad(-10), math.rad(45)},
--                    };
--GT_t.WS_t.ship_RBS_15.reference_angle_Z = math.rad(60);
GT_t.WS_t.ship_RBS_15.angles = {{ math.rad(180), math.rad(-180)}, {math.rad(-180), math.rad(180)}};
GT_t.WS_t.ship_RBS_15.moveable = false
GT_t.WS_t.ship_RBS_15.LN = {}
GT_t.WS_t.ship_RBS_15.LN[1] = {}
GT_t.WS_t.ship_RBS_15.LN[1].type = 1
GT_t.WS_t.ship_RBS_15.LN[1].distanceMin = 2000
GT_t.WS_t.ship_RBS_15.LN[1].distanceMax = 250000
GT_t.WS_t.ship_RBS_15.LN[1].reactionTime = 5; -- Preload time 240s.
GT_t.WS_t.ship_RBS_15.LN[1].launch_delay = 5;
GT_t.WS_t.ship_RBS_15.LN[1].sound = { single_shot = "Weapons/MissileLaunch2", }
GT_t.WS_t.ship_RBS_15.LN[1].external_tracking_awacs = true
GT_t.WS_t.ship_RBS_15.LN[1].sensor = {}
set_recursive_metatable(GT_t.WS_t.ship_RBS_15.LN[1].sensor, GT_t.WSN_t[0])
GT_t.WS_t.ship_RBS_15.LN[1].PL = {}
GT_t.WS_t.ship_RBS_15.LN[1].PL[1] = {}
GT_t.WS_t.ship_RBS_15.LN[1].PL[1].ammo_capacity = 1
GT_t.WS_t.ship_RBS_15.LN[1].PL[1].type_ammunition = {4,4,11,[color=Red]121[/color]} 
GT_t.WS_t.ship_RBS_15.LN[1].PL[1].name_ammunition = "RBS-15"
GT_t.WS_t.ship_RBS_15.LN[1].PL[1].reload_time = 1000000; -- never during the mission
GT_t.WS_t.ship_RBS_15.LN[1].BR = { {pos = {0, 0, 0} } }


and i add the ws to the ship like this:

 

ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.ship_RBS_15 )
GT.WS[ws].animation_alarm_state = {time = 3, arg = 30}
GT.WS[ws].center = 'MissilePoint1';
--GT.WS[ws].angles = {{ math.rad(0), math.rad(0)}, {math.rad(0), math.rad(0)}};
GT.WS[ws].LN[1].show_external_missile = true
GT.WS[ws].LN[1].max_number_of_missiles_channels = 1; -- unlimited
GT.WS[ws].LN[1].PL[1].ammo_capacity = 1;
GT.WS[ws].LN[1].BR = {
   {connector_name = 'MissilePoint1'},    
}

The problem is that i can't seem to find a way to add an entry to the shape table (the shape thing in the weapon definition is just something i was testing to solve this). I can get the missile model in game by naming it p-15m.edm and using type_ammunition 121, but that of course is not really what i'm after since it will just replace the termit model and use that.

 

So my question is: How would i go about adding the shape data and using that for my weapon system in a tech mod?

 

Addition question: Is it possible to define more than one booster nozzle location? (X_back_acc is only for one)

/Daniel

 

Heatblur Simulations

Link to comment
Share on other sites

Swither, Here is a summary of what I found when I was trying to do what you are trying to do.

 

There is a function called declare_weapon() for adding new weapons and there is also a function called add_shape_table() which you might want to use but I think they only work in the Aircraft Mod Environment. These functions are not enabled in the Tech Mod Environment which handles Ground Vehicles, Ships and Ground Statics.

 

Maybe you already know this but the Mod Environments are defined in "..Eagle Dynamics\DCS World\Scripts\Database\db_mods.lua"

 

I did try and enable some functions to work inside the TECH environment but when I tried to use them it lead to errors that crashed DCS. At this point I stopped experimenting because I didn't have time to investigate any further and I thought I'll wait and see what DCS 2.0 brings.

 

If you still wanna try and get something working what you could try is to add your weapons or add items to the shape table by using the Aircraft Mod Environment. Put your definitions for new weapons inside an existing Aircraft definition. It is a hack but it might work.

 

Definitely keep me up to date with how you go, add me to your friend list too. I am interested in Naval side of DCS in a big way and I'd like to see it advanced. :pirate:

Link to comment
Share on other sites

thanks for the quick reply :)

 

declare_weapon seems to work in the tech environment but i can't find add_shape in either tech or aircraft mod environments?!?

 

If I figure something out i'll definately post it!

/Daniel

 

Heatblur Simulations

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...